[svn:perlfaq] r6833 - perlfaq/trunk

[email protected] Sat, 2 Sep 2006 12:16:21 -0700 (PDT)
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
Author: comdog
Date: Sat Sep  2 12:16:20 2006
New Revision: 6833

Modified:
   perlfaq/trunk/perlfaq7.pod

Log:
* What is variable suicide and how can I prevent it?
	+ Changed program to match output. Instead of adding the index,
	add "bar" to the variable each time.


Modified: perlfaq/trunk/perlfaq7.pod
==============================================================================
--- perlfaq/trunk/perlfaq7.pod	(original)
+++ perlfaq/trunk/perlfaq7.pod	Sat Sep  2 12:16:20 2006
@@ -282,7 +282,7 @@
 
     my $f = 'foo';
     sub T {
-      while ($i++ < 3) { my $f = $f; $f .= $i; print $f, "\n" }
+      while ($i++ < 3) { my $f = $f; $f .= "bar"; print $f, "\n" }
     }
     T;
     print "Finally $f\n";