- 论坛徽章:
- 0
|
本帖最后由 ts99 于 2014-12-04 17:26 编辑
代码如下:
1 #!/usr/bin/perl -w
2 use Cwd;
3 use File::Spec;
4 my $cmd = getcwd;
5 foreach my $file(glob("*")){
6 #print "$file \n";
7 print " ",File::Spec->catfile("$cwd", "$file"),"\n";
8 }
9
10 print "$cmd","\n";
~
执行结果如下:
perl c2.1.pl
Use of uninitialized value in string at c2.1.pl line 7.
/a.pl
Use of uninitialized value in string at c2.1.pl line 7.
/abc.pl
Use of uninitialized value in string at c2.1.pl line 7.
/c2.1.pl
Use of uninitialized value in string at c2.1.pl line 7.
/config.pl
Use of uninitialized value in string at c2.1.pl line 7.
/file1
Use of uninitialized value in string at c2.1.pl line 7.
/file2
Use of uninitialized value in string at c2.1.pl line 7.
/hash.pl
Use of uninitialized value in string at c2.1.pl line 7.
/passwd.pl
Use of uninitialized value in string at c2.1.pl line 7.
/pm
Use of uninitialized value in string at c2.1.pl line 7.
/temp.pl
Use of uninitialized value in string at c2.1.pl line 7.
/tmp.txt
Use of uninitialized value in string at c2.1.pl line 7.
/whos_there.pl
Use of uninitialized value in string at c2.1.pl line 7.
/xx.pl
/bakdat/wzs/perl
运行环境HPUX 11.31,perl 5.8.8 |
|