Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

"Intelligent" array joining

by ngomong (Sexton)
on Feb 05, 2004 at 21:22 UTC ( [id://326891]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array1 = (1, 3, 4, 6);
    my @array2 = (1, 2, 4, 6);
    ...
    @union = grep { not $seen{$_}++ } (@union, @array3);
    
    print join(' ', @union);
    
  2. or download this
    @array1 = (1, 2, 3, 4);
    @array2 = (1, 3, 2, 4);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://326891]
Approved by davido
Front-paged by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-03-28 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found