I have a Perl application that use mode WWW::Scripter
. It parse very huge codes and all works great, just one problem occurs that I cannot understand.
I am getting error
Can't call method "addEventListener" on unblessed reference at /usr/lib/perl5/site_perl/5.8.8/JE.pm line ...
It looks like an error in JE.pm
(JavaScript Engine), which seems to be stable. This JE is called from WWW::Scripter
, which seems to be also stable module.
Tracking JavaScript source I realized, that such error sometimes (not always) happens on the following part of JavaScript:
var addEvent=(function(){if(document.addEventListener){...
which seems to be correct as well.
Let's take a look at a section of JE.pm
, where the error occurs >>
my ($method, $type) = _split_meth $m;
$proto->new_method(
$name => defined $type
? $unwrap
? sub {
$self->_cast(
scalar shift->value->$method(
$self->_unwrap(@_)),
$type
);
}
: sub {
$self->_cast(
scalar shift->value->$method(@_),
$type
);
}
: $unwrap
? sub { shift->value->$m(
$self->_unwrap(@_)) }
: sub { shift->value->$m(@_) },
);
and the "line", where such error occurs is its bottom part, so >>
: $unwrap
? sub { shift->value->$m(
$self->_unwrap(@_)) }
: sub { shift->value->$m(@_) },
So what is wrong? What exactly error unblessed reference in this case means?