Dave Adams am Dienstag, 26. Juli 2005 17.29:
> I got this error that reads something like: Can't call method "print"
> on unblessed reference at {script name} , <STDIN> chunk 1.
>
> In general terms, can anyone tell the what this is about so I can comb
> through my script and fix this problem.

This means that you tried to call a method of something that's not an object 
(= blessed reference).

In the following example, the error is triggered because $href is just a 
simple hash reference:

$ perl -le '
use strict; use warnings;
my $href={a => "b"};
$href->print;'
Can't call method "print" on unblessed reference at -e line 4.

In the next example, a blessed reference is used, but the method does not 
exist:

perl -le '
use strict; use warnings;
my $href=bless {a => "b"}, "SomeClass";
$href->print;'
Can't locate object method "print" via package "SomeClass" at -e line 4.
 

If this does not help,
- provide code
- read some perl documentation, f.e.
        perldoc perlobj
        perldoc perlmod
- wait for answers of one of the list gurus 



joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to