in reply to comparing arrays

This is a faq. The answer could also be found by typing perldoc -q equal at a prompt.

Share and enjoy! :)

Update: I should probably also mention / pimp the good node on How to RTFM. Don't read too much harshness into the F, though.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Replies are listed 'Best First'.
Re: Re: comparing arrays
by Kanji (Parson) on Apr 04, 2002 at 05:18 UTC
Re: Re: comparing arrays
by cyberconte (Scribe) on Apr 04, 2002 at 05:32 UTC
    Thank you. to start, i didn't see the faq. That helps. Also, the question was one of efficency, not of just simply doing it, since the arrays i'm dealing with have a tendency to become quite large. I originally had something crude like
    $i=0; foreach(@a) { if ($a[$i]!=$b[$i]) { return 0;} $i++; } return 1;
    So its more than just RTFMing. Althought i can't complain...having more FMs never hurts ^_^