[ Please bottom-post! ]
Ajey Kulkarni wrote:
Charles K. Clarkson wrote:Ajey Kulkarni <[EMAIL PROTECTED]> wrote:Make sure you pass var first, followed by array. There is no need to complicate with the array ref IMHO.
Once you are used to working with references, they no longer complicate argument passing. An array reference is always a single scalar while the underlying array may be any length. Passing a reference can take significantly less time.
Alright, but what is the reason for less time when you pass the ref? I always thought the perl optimizes by sending the ref even if you use a direct array.
When you pass an array, Perl *copies* the array elements to @_, so you get two instances of the data in memory.
Where can i find more detailed info?
perldoc perlsub
-- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>