Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Pair of items

by fglock (Vicar)
on Jul 29, 2003 at 20:37 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-24 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found