vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:
Is there any difference between the two examples below in regards to performance or functionality?
Using shift:
sub function1 { my $varr1 = shift; my $varr2 = shift; }
Using @_
sub fun1{ my($varr1,$varr2)=@_; }
I know that the shift will modifies @_, and the assignment from @_ does not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: difference between shift and assignment
by targetsmart (Curate) on Mar 05, 2009 at 06:56 UTC | |
|
Re: difference between shift and assignment
by cdarke (Prior) on Mar 05, 2009 at 09:53 UTC | |
|
Re: difference between shift and assignment
by jdtoronto (Prior) on Mar 05, 2009 at 06:03 UTC | |
|
Re: difference between shift and assignment
by puudeli (Pilgrim) on Mar 05, 2009 at 06:36 UTC |