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...? ;)
In reply to Re: Different way to use while loop
by Krambambuli
in thread Different way to use while loop
by ChuckP
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |