What you call educative I call overly clever and in this case outright obstructive. This is the equivalent when you get rid of the ternaryelsif( @ips ? $sel->count >= $max : $sel->count )
Which is clearer and not even longer. And once you see it like this and realize @ips is not used in within the following block, it becomes apparent you can safely omit that and the conditional becomeselsif( ( @ips && $sel->count >= $max ) || $sel->count )
One should keep conditionals as simple as possible. Similarly is thiselsif( $sel->count )
suboptimal. Apart from, again, obstructing the conditional, one should keep declaration and initialization as close to one another as possible.my @connects; for my $fh ( @connects = $sel->can_write($timeout) )
This is better.my @connects = $sel->can_write($timeout); for my $fh ( @connects )
In reply to Re^5: A question of fork efficiency
by holli
in thread A question of fork efficiency
by synless
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |