in reply to Different way to use while loop
The following code should illustrate the difference:
#!/usr/bin/perl $_ = "Foollll\nFoollll\n"; 1 while s/^Fool/Foo/g; print "1:\n\n$_"; print "\n\n"; $_ = "Foollll\nFoollll\n"; s/^Fool/Foo/g; print "2:\n\n$_";
Can you see what the output will be...? ;)
Krambambuli
---
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Different way to use while loop
by ChuckP (Novice) on Jan 14, 2015 at 02:40 UTC |
In Section
Seekers of Perl Wisdom