my $topic_obj = $mech->find_link (text_regex => qr/\Q$PrevMsgLink\E/i +);
The \Q .. \E construct backlash-escapes all special characters (it's a shortcut to the quotemeta function). That way, whatever $PrevMsgLink contains, it will match it as a literal string.
In reply to Re: How can I handle special characters in mech->find_link
by Joost
in thread How can I handle special characters in mech->find_link
by SpacemanSpiff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |