读书人

[D]Perl 小程序(一)求修改

发布时间: 2012-09-20 09:36:50 作者: rapoo

[D]Perl 小程序(1)求修改
print "input directory\n";
chomp($dir=<STDIN>);
if($dir=~/^\s*$/){
chdir or die "can not go to the home!\n";
}
else{
chdir $dir or die "can not go to the $dir";
}
@file=<*>;
foreach (@file){
print "$_\n";
}
为什么我输入空格后 返回后是 can not go to the home!, 我是win7的操作系统,是不是windows 目录结构和linux不一样所以找不到啊?

---------------------
Double行动:
原帖分数:20
帖子加分:20

[解决办法]

Perl code
if($dir=~/^\s+$/){ 

读书人网 >perl python

热点推荐