in reply to Re: order of arguments evaluated
in thread order of arguments evaluated
unless you're concerned about the joined string being enormous, in which case I'd probably sayprint join ',', @boxes;
But your code is perfectly safe. The alternatives are only evaluated if the corresponding condition indicates that they should be.my $printed = 0; foreach my $box ( @boxes ) { print ',' if $printed++; print $box; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: order of arguments evaluated
by monarch (Priest) on May 31, 2005 at 23:28 UTC | |
by Roy Johnson (Monsignor) on Jun 01, 2005 at 00:33 UTC |