Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: List Wrapper for Object Methods.

by pelagic (Priest)
on Dec 03, 2004 at 11:25 UTC ( #412088=note: print w/replies, xml ) Need Help??

in reply to Re: List Wrapper for Object Methods.
in thread List Wrapper for Object Methods.

Thanks a lot Arunbear this works nicely.
There's just one thing left for me:
I see that my AUTOLOAD method now also "catches" calls for DESTROY and I don't know exactly what's happening then. Isn't the AUTOLOAD method a litte too generic?


Replies are listed 'Best First'.
Re^3: List Wrapper for Object Methods.
by Arunbear (Prior) on Dec 03, 2004 at 12:01 UTC
    To get around that you can add the line
    return if $AUTOLOAD =~ /::DESTROY$/;
    at the beginning of the AUTOLOAD sub, or define a do-nothing DESTROY method (assuming you really don't have any cleanup to do). Perl calls the DESTROY method when it does garbage collection, even if you haven't defined a DESTROY method.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://412088]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-06-20 06:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.