Perl error message

F

fritz-bayer

Hi,

I got the following error message. I have never gotten it before. The
program has been executed already many many times.

So how come that I get the following message out of the blue and what
can I do to make sure, that my program does not terminate execution?

Can't call method "as_string" on an undefined value at
/usr/local/share/perl/5.8.4/LWP/Parallel/UserAgent.pm line 416.

Fritz
 
A

Anno Siegel

Hi,

I got the following error message. I have never gotten it before. The
program has been executed already many many times.

So how come that I get the following message out of the blue and what
can I do to make sure, that my program does not terminate execution?

Can't call method "as_string" on an undefined value at
/usr/local/share/perl/5.8.4/LWP/Parallel/UserAgent.pm line 416.

It means exactly what it says: On line 416 there is something like
"$obj->as_string( ...)", and $obj happens to be undefined. (The code
could be disguised some more.) Why it has started to be undefined
recently is for you to find out.

Anno
 
J

jussi.mononen-asdf

Can't call method "as_string" on an undefined value at
/usr/local/share/perl/5.8.4/LWP/Parallel/UserAgent.pm line 416.

Without seeing your code I would say that the object you
used to call that method does not exist anymore. Maybe
it got undefined?

For any further assistance you really should provide
a small working snippet of code demonstrating the
problem.

br,

/jUSSi
 
J

Jürgen Exner

I got the following error message. I have never gotten it before. The
program has been executed already many many times.

Can't call method "as_string" on an undefined value at
/usr/local/share/perl/5.8.4/LWP/Parallel/UserAgent.pm line 416.

So how come that I get the following message out of the blue

Many, many possibilities, e.g. you are executing a new code path that was
never executed before, your environment has changed, ...
and what
can I do to make sure, that my program does not terminate execution?

Make sure that whatever variable there is in line 416 will never have an
undefined value, maybe?

From "perldoc perldiag":
Can't call method "%s" on an undefined value
(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an undefined value.
Something like this will reproduce the error:
$BADREF = undef;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);

jue
 
C

Charles DeRykus

...
Can't call method "as_string" on an undefined value at
/usr/local/share/perl/5.8.4/LWP/Parallel/UserAgent.pm line 416.

A stack trace may be helpful to see when/where in your code
the error originated:

#!/usr/bin/perl
use strict; use warnings;
use CGI::Carp qw/confess/;
BEGIN { $SIG{__DIE__} = sub { confess @_; }; }
....


hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,976
Members
47,536
Latest member
MistyLough

Latest Threads

Top