in reply to Which, if any, is faster?

in addition to what the others already stated, there is a means of speeding up your own code as well:
1.) always pass data structures by reference, not by value!
2.) if you got a hashref, there's no need for iterating over all its keys, alike for an arrayref.
sub new { my ($class, $params) = @_; my $self = $params; bless $self, $class; }
i rather bet that benchmarking our both codes will show the difference between them.

language is a virus from outer space.

Replies are listed 'Best First'.
Re^2: Which, if any, is faster?
by PetaMem (Priest) on Jun 01, 2005 at 15:03 UTC
    And while we are at it, a
    sub xx { my $var1 = shift; my $var2 = shift; ...
    is faster than
    sub xx { my ($var1,$var2) = @_; ...
    It also gives you the oportunity for better comments and I personally feel more safe if crunching @_ instead of copying and leaving it untouched.

    Bye
     PetaMem
        All Perl:   MT, NLP, NLU