I often have a subroutine in Perl that fills an array with some information. Since I\'m also used to hacking in C++, I find myself often do it like this in Perl, using refer
3 other potentially LARGE performance improvements if you are reading an entire, largish file and slicing it into an array:
Passing an array ref to the function allows the main program to deal with a simple array while the write-once-and-forget worker function uses the more complicated "$@" and arrow ->[$II] access forms. Being quite C'ish, it is likely to be fast!