perl unless循环

前端之家收集整理的这篇文章主要介绍了perl unless循环前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
[oracle@jhoa 6]$ cat 4.pl 
$mon = $ARGV[0];
unless ($mon eq "Feb") {
print "This month has at least thirty days.\n";
}else {
print "Do you see what's going on here?\n";
}
[oracle@jhoa 6]$ perl 4.pl Feb 
Do you see what's going on here?

---条件为假时,才执行
[oracle@jhoa 6]$ perl 4.pl Febf
This month has at least thirty days.



unless = if not

猜你在找的Perl相关文章