ChuckP has asked for the wisdom of the Perl Monks concerning the following question:
Greetings,
I just had a co-worker ask what this code did and I didn't know.
while (<FH>) { 1 while s/^FOO/BAR/g; print "$_"; }
It seems to work just like:
while(1) { s/^FOO/BAR/g; print "$_"; }Any thoughts?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Different way to use while loop
by LanX (Saint) on Jan 09, 2015 at 03:44 UTC | |
by Anonymous Monk on Jan 09, 2015 at 03:48 UTC | |
by LanX (Saint) on Jan 09, 2015 at 03:52 UTC | |
by dsheroh (Monsignor) on Jan 09, 2015 at 12:40 UTC | |
|
Re: Different way to use while loop
by Krambambuli (Curate) on Jan 09, 2015 at 09:41 UTC | |
by ChuckP (Novice) on Jan 14, 2015 at 02:40 UTC | |
|
Re: Different way to use while loop
by soonix (Chancellor) on Jan 09, 2015 at 09:41 UTC | |
|
Re: Different way to use while loop (obfuscation)
by Anonymous Monk on Jan 09, 2015 at 03:32 UTC | |
by Anonymous Monk on Jan 09, 2015 at 03:45 UTC |