in reply to Hash key intersection
my @A{ qw[ 1 3 5 6 ] } = (); my @B{ qw[ 1 2 3 4 6 7 ] } = (); print join'.', ( exists $A{ $_ } ? 'A:' . $_ : ' ' ), ( exists $B{ $_ } ? 'B:' . $_ : ' ' ) for sort keys %{ { %A, %B } }; A:1.B:1 .B:2 A:3.B:3 .B:4 A:5. A:6.B:6 .B:7
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: A man walks into a bar with a hash under each arm!
by merlyn (Sage) on Dec 30, 2003 at 20:00 UTC | |
by BrowserUk (Patriarch) on Dec 30, 2003 at 20:17 UTC |