Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

(MeowChow) Re2: (Efficiently) comparing arrays

by MeowChow (Vicar)
on Apr 04, 2002 at 10:15 UTC ( #156613=note: print w/replies, xml ) Need Help??


in reply to Re: (Efficiently) comparing arrays
in thread comparing arrays

You can get about a 30% performance improvement over the original naive code with the following:
  
my ($first, $second) = @_; return 0 if @$first != @$second; my $i = 0; $second->[$i++] ne $_ && return 0 for @$first; return 1;
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://156613]
help
Chatterbox?
[hippo]: See also Getting Started with Perl for some gentle introductory tutorials.
[thao4]: I don't see where I can post my question. I am french so not good in English
[erix]: go to the bottom of this page: Seekers of Perl Wisdom

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-02-21 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (276 votes). Check out past polls.

    Notices?