What stevieb said. Handing someone a bunch of code and saying "This doesn't work. Please figure out how it should work and fix it" is not likely to be productive unless you also hand over a bunch of money.
That said, one note: In the regex
my @urls=$response_body =~ m{(http://b.thumbs.redditmedia.com/ ... }gi;
the sub-pattern b.thumbs.redditmedia.com has embedded . (dot) metacharacters that match anything (except a newline, unless the /s switch is asserted, which it isn't). Here's the effect:
Now try meta-quoting in some way, e.g.:c:\@Work\Perl\monks>perl -wMstrict -le "for my $str (qw(aXbXc a.b.c)) { printf qq{for '$str' }; print $str =~ m{ a.b.c }xms ? 'match' : 'NO match'; } " for 'aXbXc' match for 'a.b.c' match
c:\@Work\Perl\monks>perl -wMstrict -le "for my $str (qw(aXbXc a.b.c)) { printf qq{for '$str' }; print $str =~ m{ \Qa.b.c\E }xms ? 'match' : 'NO match'; } " for 'aXbXc' NO match for 'a.b.c' match
Give a man a fish: <%-{-{-{-<
In reply to Re: regex problem
by AnomalousMonk
in thread regex problem
by grasshopper!!!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |