in reply to regex hangs forever

Try this:
my @content = get("$url$cnt"); while my $beaver (split/href/,@content) { if ($beaver =~ m#/files/images/thumb/ ([a-zA-Z0-9]+\.jpg)#gx) { push(@images, "http://www.imagebeaver.com/files/images/$1:$1"); } }

Replies are listed 'Best First'.
Re^2: regex hangs forever
by Anonymous Monk on Dec 15, 2006 at 05:25 UTC
    /g makes the difference
    C:\>perl -le"print $1 while '1234' =~ /(\d)/g" 1 2 3 4 C:\>