Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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


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

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 having an uproarious good time at the Monastery: (8)
As of 2014-10-02 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (45 votes), past polls