No matter what programming language you use, inline functions
are faster than subroutine calls. However, perl suffers
no more overhead for subroutine calls than any other
language. Breaking down an easy to read and update perl
program just to squeeze a little speed out of it is the
wrong way to do it. This is basically true of any language.
The only time you want to sacrifice readablity and
maintainability is when you have some computationally
heavy code that you know will need tweeking. 20 function
calles doesn't even come close.
That being said, your use of @options in the subroutine
call poses a bit of a problem. Perl will copy this array,
which, depending on its size, could incur some serious
overhead. Pass the array by reference.
---
Crulx
crulx@iaxs.net
Hmm, isn't writing:
[ @options ]
going to create an anonymous array containing @options? I think it would be more clear to write:
values => \@options
however.