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!
In reply to Re^4: list item comparison
by nitin1704
in thread list item comparison
by robertw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |