Subject: | bug in JE 0.042: no implicit .exec on regexp |
Date: | Tue, 9 Mar 2010 20:22:37 -0800 |
To: | bug-JE [...] rt.cpan.org |
From: | craig [...] animalhead.com |
The ancient ClientReferenceJS13.pdf defines the exec method of a
regexp as follows:
---------------
exec
Executes the search for a match in a specified string. Returns a
result array.
Syntax regexp.exec([str])
regexp([str])
Parameters
regexp The name of the regular expression. It can be a
variable name or a literal.
str The string against which to match the regular
expression. If omitted, the value of RegExp.input is used.
Description As shown in the syntax description, a regular
expression’s exec method can be
called either directly, (with regexp.exec(str)) or
indirectly (with regexp(str)).
----------------
Under JE 0.042, perl 5.10.1, FreeBSD 6.3 the following statement
var test = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/(ipaddr);
threw the following error:
DB<194> p $@
Can't locate object method "call" via package "JE::Object::RegExp" at /
usr/local/lib/perl5/site_perl/5.10.1/JE/Code.pm line 1274.
Adding the explicit '.exec' made everything work well:
var test = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})
$/.exec(ipaddr);