Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gabor (1626)

gabor
  (email not shown publicly)
http://szabgab.com/

Perl developer and trainer [szabgab.com]
Test automation using Perl [szabgab.com]

Journal of gabor (1626)

Saturday February 07, 2004
04:32 AM

smatch in your face

[ #17263 ]
What will this snippet print ?

$s = "apple";
$rep = "banana";
while ($s =~ s/a/$rep/) {}
print $s;

 

 

 

Yes, this is nice infinate loop that was biting me for some 3 days. It was hidden somewhere in my code and was somewhat more complicated and I had good reasons to think that the problem is somewhere else but hey this is such a stupid bug.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.