On 11-03-02 04:15 PM, Parag Kalra wrote:
A Perl script may have many functions. When we execute the script via Perl
Interpreter, does all the functions are loaded into memory?


All the functions are compiled and loaded.

Sometimes we just like to keep the coded functions in the script with the
idea that we may need them in future. Will removing an un-called functions
improve the execution time?

Yes but on modern machines, you will need an awful lot of subs to get a noticeable slow down.

The AUTOLOAD feature can be used to delay the compilation and loading of a sub but I have never seen it used in practice. Most modern machines are fast enough so compiling unused subs is not a problem.


--
Just my 0.00000002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to