Re: "Can't bless non-reference" error, bug or not?
[email protected] (Brian Jepson) Tue, 28 Mar 2000 16:34:48 -0500 (EST)
| Newsgroups | perl.jpl |
|---|---|
| Message-ID | <Pine.LNX.4.10.10003281632200.1356-100000@localhost> |
On Tue, 28 Mar 2000, Chunyan Wei wrote:
> I am working on something using JPL from Perl side and have got
> some errors with the bless function in "AutoLoader.pm":
>
> >>>Can't bless non-reference value at AutoLoader.pm line 237.
>
> The line 237 of Autoloader is:
> bless $self->$callmethod($mid, \@_), $blesspack;
>
> I have solved my problem by adding a line to check the reference:
>
> if ( ref $self->$callmethod($mid, \@_)) {
> bless $self->$callmethod($mid, \@_), $blesspack;
> }
>
> Brian, what is your opinion?
>
I haven't had my hands in the code for quite some time, so I'm afraid I
can't intelligently comment - it doesn't ring a bell with me, but it looks
like a reasonable fix, since it checks before calling a method.
Brian Jepson * ([email protected]) * http://users.ids.net/~bjepson