go ahead... be a heretic | |
PerlMonks |
Re^3: Logical Not and arguments to grepby Marshall (Canon) |
on Apr 02, 2012 at 01:02 UTC ( [id://962947]=note: print w/replies, xml ) | Need Help?? |
I also prefer to use the block form of map and grep. The comma operator is useful in other ways..see the command loop I coded at Re: Storing 10 numbers in array. In the statement, The comma operator allows this to be a single statement. You can't put two statements like: into the while() conditional. But this statement which uses the comma operator is ok. The "truth or falseness" of the statement is decided by the last clause (the input of the data - not the return value of the print which will be a "1"). Note the paren's are required. By doing it this way, a re-prompt happens automatically at every loop iteration without having to code the prompting statement within the loop (and having a standalone initial prompting statement before the loop to get things started).
In Section
Seekers of Perl Wisdom
|
|