in reply to Re: benchmark for shift vs list assignment for object methods
in thread benchmark for shift vs list assignment for object methods
>You see that, shift modifies the array (as i'm sure you already know). Thus, the benchmark is void.
Huh? Where is the problem? You can modify test internal data as much as you want, as long as it is initialized the same way for each test. It is no problem to modify @_ here. There would be a problem if he would directly modify the global @args. Which he doesn't do. Or are you trying to indicate that
my @arr = ('a', 'b', 'c'); sub dosth { my $first = shift; } dosth(@arr); print "@arr";
results in "a b"? Of course not, right?
|
---|