Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Apologies for the confusion.

by tilly (Archbishop)
on Sep 19, 2000 at 19:49 UTC ( [id://33109]=note: print w/replies, xml ) Need Help??


in reply to RE: (3) (tilly) 1: Fly Subroutines on the Fly
in thread Fly Subroutines on the Fly

What I didn't think was worthwhile is worrying about which low-level operation you can get away with which times. Instead analyze your code for steps that may or may not ever be needed, and only include the ones that you are using this time.

This results in a structure with a lot of single level if statements, which avoids the explosion of possible combinations. Flexibility without undue code complication and without paying run-time performance except for the steps you need.

As for what CGI does, the trick is that if you have a function in a package named AUTOLOAD, then it will be called on any unknown functions or method calls. $AUTOLOAD is the name of the unknown method. So what happens is that he creates a hash of possible methods he may or may not ever need, and an AUTOLOAD function. Upon your first trying to call a function or method he creates it on the fly and runs it. Upon your second try the method is already there, and is called directly. If you need all of the methods this is slower than just compiling directly. If you only need a few then this is faster.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found