http://qs321.pair.com?node_id=11136885


in reply to Re^4: Automating execution of shell scripts
in thread Automating execution of shell scripts

I guess it would be better (also faster?) if it is done in the main program and not in a subroutine ...

A highly questionable guess IMHO. Reasonable factoring of code into subroutines certainly has the benefits of increased clarity and maintainability, encapsulation, etc., as you mention. The only speed advantage of inlining might be in a case in which you are calling a relatively simple function a gazillion times in a program. In the typical case, Perl call-return overhead vanishes into the background of a script.

(And yes, please see Short, Self-Contained, Correct Example.)


Give a man a fish:  <%-{-{-{-<