Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Match string in array

by chester (Hermit)
on Oct 03, 2005 at 19:15 UTC ( [id://497028]=note: print w/replies, xml ) Need Help??


in reply to Match string in array

The easy way...

use warnings; use strict; use Set::Array; my $array1 = Set::Array->new('one','red','orange','brown','green','blu +e','scarlett','fourteen'); my $array2 = Set::Array->new('red','orange','yellow','green','blue','i +ndigo','violet'); print "In array1, not in array2:\n"; print join "\n", $array1->difference($array2), "\n"; print "In array2, not in array1:\n"; print join "\n", $array2->difference($array1), "\n";

Output:

In array1, not in array2: fourteen one brown scarlett In array2, not in array1: violet indigo yellow

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-18 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found