in reply to How can I handle special characters in mech->find_link

Your regex doesn't work because your string $PrevMsgLink contains characters that are special in regular expressions, notably the pair of parentheses. You can use \Q...\E to prevent those chars from being interpreted as regular expression special characters:

my $topic_obj = $mech->find_link (text_regex => qr/\Q$PrevMsgLink\E/i +) or die "Didn't find anyhting matching '$PrevMsgLink' in the page!" +;

But what you really should do instead of scraping the eBay website is to use the Net::eBay API, which gives you fast, robust and convenient access to all of eBay, within the limits of the eBay Terms of Use.

Replies are listed 'Best First'.
Re^2: How can I handle special characters in mech->find_link
by SpacemanSpiff (Sexton) on Jun 12, 2006 at 08:17 UTC
    Thanks a ton guys, that did it.

    *tries desperately to commit to memory*

    I'm actually scraping Yahoo Groups as our group is moving to another format. I know there were some modules out there to do this, but Yahoo changes their message format frequently, so they tend to be out of date. Besides, I figured it would be a great project to do some immersion training with Perl.

    Thanks again!