http://qs321.pair.com?node_id=1112717


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
---