Not idea how this is happening, but it seems my perl regular expression matches do not update to the next match, after doing a match. Instead of updating the $& and $1 variables with each match, it gets stuck in the first one.
I've looker everywhere and found this extremely frustrating.
See output from debugger below, as you can see, the first match makes sense, but the second one doesn't.
Thanks
DB<79> $riz =~ m{url=(.*?)Support};
DB<80> p$&;
url="http://www.svartapelsin.se" draggingName="Bunny Camp Support
DB<81> $riz =~ m{href=(.*artist?)};
DB<82> p $&;
url="http://www.svartapelsin.se" draggingName="Bunny Camp Support
DB<83>
Update: Here's another sample showing that the text "artist" is in the string, but it is still not finding it. The value of $riz is a huge HTML code, so it is hard to post.
DB<103> $riz =~ m{url=(.*?)Support};
DB<104> p $&;
url="http://www.svartapelsin.se" draggingName="Bunny Camp Support
DB<105> $riz =~ m{artist};
DB<106> p $&;
url="http://www.svartapelsin.se" draggingName="Bunny Camp Support
DB<107> p string.index($riz,"artist");
string105
DB<108>
My $riz is all the HTML in this link http://itunes.apple.com/us/app/id385972277
When you use the user agent iTunes/10.2 (Macintosh; U; PPC Mac OS X 10.2)
Here's another example with the same $riz
DB<128> $riz =~ m/.*/;
DB<129> p $&;
url="http://www.svartapelsin.se" draggingName="Bunny Camp Support
DB<130>
...
DB<136> p substr $riz,0,20;
<?xml version="1.0"
DB<137>
I mean, isn't this just ridiculous? it should've just outputted the value of $riz no? Which as you can see is different form what is shown. Also, how could m/.*/ not be a valid regex?