Array subtraction, like sets
From: Robin Sheat (robin_at_kallisti.net.nz)
Date: 01/30/04
- Next message: R. Joseph Newton: "Re: How to call perl programs from ASP page"
- Previous message: R. Joseph Newton: "Re: Regarding Text Widget in Perl/Tk"
- Next in thread: Wiggins D Anconia: "Re: Array subtraction, like sets"
- Maybe reply: Wiggins D Anconia: "Re: Array subtraction, like sets"
- Maybe reply: Bob Showalter: "RE: Array subtraction, like sets"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 18:05:55 +1300 To: beginners@perl.org
Hey there, what is a nice way of doing what this looks like it should
do:
@a=([1,2,3],[5,5,5],[9,8,7]);
@b=([5,5,5],[1,2,3]);
@c=@a-@b;
and have @c == ([1,2,3]);
Is there a good way of doing this? (I've tried the obvious things on the
command line, to no avail). I could probably write a function for it
without too much trouble, but it could get ugly :)
cheers,
-- Robin <robin@kallisti.net.nz> JabberID: <eythian@jabber.org> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663
- application/pgp-signature attachment: stored
- Next message: R. Joseph Newton: "Re: How to call perl programs from ASP page"
- Previous message: R. Joseph Newton: "Re: Regarding Text Widget in Perl/Tk"
- Next in thread: Wiggins D Anconia: "Re: Array subtraction, like sets"
- Maybe reply: Wiggins D Anconia: "Re: Array subtraction, like sets"
- Maybe reply: Bob Showalter: "RE: Array subtraction, like sets"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|