in reply to order of arguments evaluated
my $rownew = 0; foreach my $box ( @boxes ) { if ( $rownew ? 1 : $rownew++ ) { print( "," ); } print( $box ); }
This, too, depends on the fact that $rownew is evaluated on the left hand side of the ? operator before the result. It's one of the few times, if ever, that I would want to be silly enough to mix ++ and dependant code on the one line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: order of arguments evaluated
by Roy Johnson (Monsignor) on May 31, 2005 at 18:25 UTC | |
by monarch (Priest) on May 31, 2005 at 23:28 UTC | |
by Roy Johnson (Monsignor) on Jun 01, 2005 at 00:33 UTC |