Subject: | bugfix 3035 may be too restrictive? |
Date: | Wed, 16 Aug 2006 12:27:13 -0400 |
To: | bug-WWW-Mechanize [...] rt.cpan.org |
From: | "Eric Law" <ericslaw [...] gmail.com> |
"bugfix #3035 find_link() et al should squak on bad regexes"
seems to have added code that tries to insure that the values to
url_regex and text_regex are regular expressions.
The specific bit of code looks like this:
$val_regex = ( ref($val) eq "Regexp" );
But I am not yet able to force a text string into a regex _except_ by doing the
inverted if in the following code snippet. Keep in mind that the
split actually occurs on an input file, not on the actual string shown
here:
my ( $field, $value ) = split(/,/, "url_regex, pattern", 2 );
# having to do this next step seems contradictory to just passing in
the parameters
$value = qr/$value/ if $field =~/_regex/;
$mech->find_link( $field => $value );
seems like bugfix 3035 makes the tool harder to use, or should contain a small
snippet on how to force a string into a Regexp ?
-Eric Law