in reply to CGI::Simple vs CGI.pm - Is twice as fast good enough?
###################################################################### +######### ################# THESE FUNCTIONS ARE AUTOLOADED ON DEMAND ########### +######### ###################################################################### +#########
So, say, even if I went the 'use CGI;' way, the only time wasted here (provided I have no interest in making a call to the CGI::read_from_client() method) is that required for the hash to load. Perl parser wouldn't waste a nanosecond on parsing the actual sub. This is a huge time saver compared to if subs were not nicely hidden inside a hash etc. (the standard way).%SUBS = ( 'read_from_client' => <<'END_OF_FUNC', # Read data from a file handle sub read_from_client { my($self, $fh, $buff, $len, $offset) = @_; local $^W=0; # prevent a warning return undef unless defined($fh); return read($fh, $$buff, $len, $offset); } END_OF_FUNC ### MANY OTHER EXCITING SUBS ### );
"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: CGI::Simple vs CGI.pm - Is twice as fast good enough?
by tachyon (Chancellor) on Feb 16, 2002 at 12:01 UTC | |
by Ovid (Cardinal) on Feb 16, 2002 at 14:54 UTC | |
by tachyon (Chancellor) on Feb 16, 2002 at 17:08 UTC | |
by IlyaM (Parson) on Feb 16, 2002 at 22:24 UTC | |
by IlyaM (Parson) on Feb 16, 2002 at 22:21 UTC |