YUANya

导航

 

 

调用参数

1.txt
ssssssssssss
ssssssssss
dddddddddddd
2222222222
sssssssssssssssss
#!/usr/bin/perl

use strict;
use warnings;

while(<>)
{
    chomp;
    $_ = <>;
    print "$_";
}

##ssssssssss
##2222222222
##Use of uninitialized value $_ in string at test.pl line 10, <> line 5.

print "$0\n";

##test.pl

问题一:文件无法传入


@ARGV = (1.txt,2.txt,3.txt);

while(<>)
{
    chomp;
    $_ = <>;
    print "$_";
}

##Bareword found where operator expected at test.pl line 6, near "1.txt"
        (Missing operator before txt?)
##Bareword found where operator expected at test.pl line 6, near "2.txt"
        (Missing operator before txt?)
##Bareword found where operator expected at test.pl line 6, near "3.txt"
        (Missing operator before txt?)
##syntax error at test.pl line 6, near "1.txt"
##Execution of test.pl aborted due to compilation errors.

posted on 2019-06-15 20:56  YUANya  阅读(226)  评论(0编辑  收藏  举报