Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Pair of items

by fglock (Vicar)
on Jul 29, 2003 at 20:37 UTC ( #278979=note: print w/replies, xml ) Need Help??


in reply to Pair of items

Note: this would fail if you had repeated numbers inside an item, like (1,1,2).

use strict; my (@a, @b); @a = (1,2,3); @b = (5,6,7); { my %test; @test{@a,@b}=1; print scalar keys %test == 6 ? 'ok' : 'not'; } # ok @a = (1,2,3); @b = (2,4,6); { my %test; @test{@a,@b}=1; print scalar keys %test == 6 ? 'ok' : 'not'; } # not

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2023-02-09 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (44 votes). Check out past polls.

    Notices?