in reply to Re^3: list item comparison
in thread list item comparison
Yes, it's easier to understand the way you presented it. The one line syntax (statement modifier form) is fairly common in Perl though, and it's great if beginners can pick it up. @OP: This syntax can be used with both loops and conditions. E.g:
if($cond){ doSomething(); }
can be replaced by:
doSomething() if $cond;
The only catch is that you can execute only one statement per iteration/condition with this syntax. Happy coding!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: list item comparison
by johngg (Canon) on Jul 13, 2012 at 08:52 UTC | |
by nitin1704 (Sexton) on Jul 13, 2012 at 09:16 UTC |