Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Strange code execution with 'AUTOLOAD'

by Masem (Monsignor)
on Jul 01, 2001 at 22:24 UTC ( [id://93043]=note: print w/replies, xml ) Need Help??


in reply to Strange code execution with 'AUTOLOAD'

Having run into this yesterday, if you defined AUTOLOAD, you are required to define a DESTROY method in your class (in otherwords, you're getting that error as run-time as the class tries to fully define itself, include DESTROY, and fails). DESTROY is the destructor, and if you do any special resource allocation (opened files, database connections) this is the point where you want to dispose of them. However, if you are only holding data in your class and nothing else, DESTROY can simply be an empty method.

Define this in your class, and you'll find that your class should work now.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
  • Comment on Re: Strange code execution with 'AUTOLOAD'

Replies are listed 'Best First'.
Re: Re: Strange code execution with 'AUTOLOAD'
by nysus (Parson) on Jul 01, 2001 at 22:29 UTC
    Mucho thanks. I'm guessing this is new to 5.6.1, then? It's not mentioned in the Conway book (at least not what I've read so far).

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://93043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found