Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Comparing arrays with text contents

by Samy_rio (Vicar)
on Jun 21, 2006 at 11:00 UTC ( [id://556631]=note: print w/replies, xml ) Need Help??


in reply to Comparing arrays with text contents

Hi, Try this using Array::Compare module.

TIMTOWTDI

use strict; use warnings; use Array::Compare; my @anc=("BX1.01.001","BX1.01.002","BX1.01.003","BX1.01.004","BX1.01. +005","BX1.01.006"); my @ind=("BX1.01.002","BX1.01.002","BX1.01.003","BX1.01.004","BX1.01. +005","BX1.01.006"); my $comp = Array::Compare->new(); if (!($comp->compare_len(\@anc, \@ind))){ print "Indicator and anchor count do not match"; exit; } if ($comp->compare(\@anc, \@ind)){ print "Same Array OK"; }else{ print "Different Array OK"; }

Use $comp->perm(\@anc, \@ind) for compare the array without order.

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-18 17:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found