Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Is there a way to compare strings without using an array?

by mrstlee (Beadle)
on Oct 19, 2011 at 13:47 UTC ( #932406=note: print w/replies, xml ) Need Help??


in reply to Re^3: Is there a way to compare strings without using an array?
in thread Is there a way to compare strings without using an array?

I'm not 100% sure what you want to do here Jeri. The sample below assumes you have a single string composed of 9 character sequences. When the 'for' has run the keys of %uniq will be the unique 9 character sequences.

It would take a while and a lot of memory over 5 mill x 9 char sequences!

my $str = join '',(648040620,637132715,649986572,648040620 ); my $proteins_count = length ($str)/9; my %uniq; do { $uniq{$_}++ unless $uniq{$_} } for unpack "(A9)$proteins_count" , $str; print "@{[keys %uniq]}\n";
Prints ..
637132715 648040620 649986572

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2016-10-01 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (3 votes). Check out past polls.