Is there a reason that the idea merlyn mentioned (that I think is a excellent use of perl) was comprehensively glossed over?
I'd also try and do away with the if block but I think cond or next; reads a little unintuatively and would probably use
next unless cond;
for ( 'arg1' .. 'arg5', "arg19", 'gee13' .. 'gee37' ) { next unless $object->method( $_ ); # do stuff }
In reply to Re: Re^2: On Foreach Loops and Maintainability
by BrowserUk
in thread On Foreach Loops and Maintainability
by rob_au
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |