Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Create unique array --the hard way!

by Laurent_R (Canon)
on Mar 07, 2014 at 19:52 UTC ( #1077450=note: print w/replies, xml ) Need Help??


in reply to Create unique array --the hard way!

A Perl one-liner doing this:
$ perl -e 'my $prev; my @c = qw /a c d e r f e a e z e a /; print join + " ", grep { $_ ne $prev and $prev = $_;} sort @c' a c d e f r z

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2020-08-09 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (54 votes). Check out past polls.

    Notices?