Check For null Arguments - PerlMonks

文章推薦指數: 80 %
投票人數:10人

A better way to check for particular value is defined or not, use defined function in perl. ... defined function will return true if EXPR has a ... Yourskillwillaccomplishwhattheforceofmanycannot   PerlMonks   CheckFornullArguments byrfleisch(Initiate) Log inCreate a new user The Monastery Gates Seekers of Perl Wisdom Meditations Cool Uses For Perl Obfuscation Tutorials Poetry Reviews Perl News Donate Recent Threads Newest Nodes Super Search PerlMonks Discussion What's New onMar13,2013at15:21 UTC (#1023230=perlquestion:printw/replies,xml) NeedHelp?? rfleischhasaskedforthewisdomofthePerlMonksconcerningthefollowingquestion: Helloall, Ican'tseemtogetthecorrectsyntaktocheckforNOitemsonthecommandline. #!/usr/local/ActivePerl-5.16/bin/perl usePOSIXqw/strftime/; subfixdir{ my$dir=shift; opendirmy$DH,$dirordie"NotFound....$dir:$!"; while(my$f=readdir$DH){ nextifgrep$_eq$f,qw/.../; (my$new=$f)=~s/[^a-zA-Z0-9_.]/_/g; nextif($neweq$f); while(-e"$dir/$new"){$new.="1";} printSTDERR"Renaming:$f->$new\n"; rename"$dir/$f","$dir/$new"; fixdir("$dir/$new")if-d"$dir/$new"; } } $Do_Dir=@ARGV[0]; print("ARG=","$Do_Dir","<<<<<



請為這篇文章評分?