in reply to while loop break when sub call
runs just as I would expect, with no infinite loop.perl -E 'sub func {"@_"} while (($name) = getgrent){if ($name =~ /^som +etext_(\w+)/){func($name,$1);say $name}}';
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: while loop break when sub call
by papillon (Initiate) on Jan 09, 2015 at 18:16 UTC | |
by locked_user sundialsvc4 (Abbot) on Jan 09, 2015 at 22:39 UTC |