This is an oddball issue I\'ve encountered (and probably have seen before but never paid attention to).
Here\'s the gist of the code:
my $url = \'htt
m//g does not reset the position. You need to do that manually. See this for reference: http://perldoc.perl.org/functions/pos.html
I believe you just set pos to 0 or undef and it will work.