I
ioneabu
Just curious, would it be possible for a future version of Perl to
support this sort of statement?
print for @a if $a;
or
print for @$_ if /^a/ while(<A>);
I imagine that a module could be written to do it:
multiples 'print for @a if $a'
where the multiples function would construct a function to execute the
statement properly. The problem is that it already looks ugly and the
implementation would probably be very difficult.
Is there a logic problem with allowing more than one statement
modifier?
Thanks!
wana
support this sort of statement?
print for @a if $a;
or
print for @$_ if /^a/ while(<A>);
I imagine that a module could be written to do it:
multiples 'print for @a if $a'
where the multiples function would construct a function to execute the
statement properly. The problem is that it already looks ugly and the
implementation would probably be very difficult.
Is there a logic problem with allowing more than one statement
modifier?
Thanks!
wana