Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re (tilly) 1: Short version of autoload

by bikeNomad (Priest)
on Jun 03, 2001 at 04:38 UTC ( [id://85253]=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 1: Short version of autoload
in thread Short version of autoload

I agree about not wanting to make a potentially tricky routine like this into Perl golf... though the title was short version of AUTOLOAD and it certainly lived up to that...

One minor thing; wouldn't you be better off doing a

goto &$field;
so that the call stack doesn't show the AUTOLOAD? After all, if you've created the subroutine, the AUTOLOAD isn't significant any more.

Replies are listed 'Best First'.
Re (tilly) 3: Short version of autoload
by tilly (Archbishop) on Jun 03, 2001 at 04:49 UTC
    It is traditional to put a goto there for exactly that reason. However this time I know it won't matter.

    Besides which a friend of mine demonstrated to me that jumping from sub to sub with goto could lead to a memory leak (he wrote a tail-recursive sub with a goto and after several runs with large argument lists ran out of memory) so I don't use that goto unless I really feel it is necessary for Perl to work correctly.

    I don't know if that bug has been reported to p5p yet. At the time I intended to check whether it still existed in a development version and then report it, but then I got busy...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-26 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found