http://www.perlmonks.org?node_id=192137


in reply to Re: Re: Re: Optimizing existing Perl code (in practise)
in thread Optimizing existing Perl code (in practise)

The "shift" options is good to use when you send big data to the function! The process of the command is not fast, because it need to cut the value from the array, reorder the array, and create and save to a scalar variable! "shift" is good to use for big data because you don't leave in the memory the data 2 times!

Good point!

I'd try to avoid that by passing a reference to the large scalar to the sub instead, but if you're expecting possibly large scalar arguments by value (edit: because you need to modify them, maybe), you're right.
--
Mike