11/24 I was looking at the Perl CGI.pm and I noticed that most of its
functions existed only as source code stored in a big hash of
%SUBS = (sub_name => 'sub source') What's the reason for doing this?
\_ They compile the functions on demand, to reduce startup time.
\_ So if you make repeated calls to some of these functions, will
you see much of a performance hit?
\_ Nope -- once CGI.pm compiles a function, it becomes an
ordinary perl function with no extra overhead. On the other
hand, even that single compilation is a waste if you're using
something like mod_perl that precompiles your code, so CGI.pm
does have an option (-compile) to disable the hack and just
define everything at compile time. --mconst |