Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Am I asking for trouble with my own AUTOLOAD sub?

by dws (Chancellor)
on Feb 02, 2002 at 02:45 UTC ( #142853=note: print w/replies, xml ) Need Help??


in reply to Am I asking for trouble with my own AUTOLOAD sub?

I'm wondering if there is something I'm not anticipating. Is there a problem with this approach that I don't see or am I just paranoid?

A bit of paranoia can be healthy.

One of the more robust and interesting AUTOLOADs I've seen is in CGI.pm (actually, in CGI::_compile, which CGI::AUTOLOAD delegates to). I recommend it for careful study. It shows a few edge cases that many examples don't cover.

I see that your AUTOLOAD doesn't actually introduce any new symbols in a package's namespace. Rather, it's just a backstop that make indirect subroutine calls. Is this what you intended?

Replies are listed 'Best First'.
Re: Re: Am I asking for trouble with my own AUTOLOAD sub?
by CharlesClarkson (Curate) on Feb 02, 2002 at 04:50 UTC

    Rather, it's just a backstop that make indirect subroutine calls. Is this what you intended?

    Yes, I originally wrote the AUTOLOAD for Address.pm and thought, "Hey, I could stick this in a base class and use it to supply automatic methods for other classes as well." Extending Laziness with OO.




    HTH,
    Charles K. Clarkson

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2020-10-24 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (246 votes). Check out past polls.

    Notices?