Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: list of unique strings, also eliminating matching substrings

by wind (Priest)
on May 21, 2011 at 03:32 UTC ( #906030=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @list = qw(AGCT AGGT GG AGCT);
    
    ...
    my @unique = grep {defined} @list;
    
    print "$_\n" for @unique;
    
  2. or download this
    use strict;
    use warnings;
    ...
    my @unique = grep {defined} map {@$_} values %bucket;
    
    print "$_\n" for @unique;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2021-06-17 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (84 votes). Check out past polls.

    Notices?