Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Re: All array elements the same?

by Fastolfe (Vicar)
on Aug 01, 2000 at 22:34 UTC ( #25528=note: print w/replies, xml ) Need Help??


in reply to Re: All array elements the same?
in thread All array elements the same?

This wouldn't work very well for arrays that concatenate the same but have different values. Consider:
@one = (undef, 1, 2); # "12" @two = (1, undef, 2); # "12" @one = (12, 3, 4); # "1234" @two = (1, 2, 34); # "1234"
The Array::Compare module basically does a join() using an unlikely delimiter (like a pipe character or \0 or \255). Unfortunately, my own benchmarks typically put a "brute force" comparison faster than Array::Compare (sometimes significantly, depending on the amount and type of data in the two arrays), especially when dealing with numeric items in the array. Conversions of data types to strings plus string comparisons tend to be expensive in bulk. If you're working with string data, it might not be so bad.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://25528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2022-09-29 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?