37,720
社区成员
发帖
与我相关
我的任务
分享
print "test0";
getopts("$opt_string",\%opt) or usage();
print "test1";
$target = $opt{u} if $opt{u};
print $target;
$dir = $opt{d} if $opt{d};
$file = $opt{f} if $opt{f};
if(!$target || (!$dir && !$file)){
usage();
}
希望高手能指点下
$target = $opt{u} if $opt{u}; 这种语法是什么意思?或者提供下学习了解它的资料
my $dir ;
if(defined($opt{u}) && !$opt{u}){
$dir = $opt{d};
}
if($opt{u})
{
$target=$opt{u};
}