Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: tips on how to speed up a very slow perl script requested

by jwkrahn (Abbot)
on May 06, 2009 at 18:30 UTC ( [id://762351]=note: print w/replies, xml ) Need Help??


in reply to tips on how to speed up a very slow perl script requested

It looks like you want something like:

#!/usr/local/bin/perl use strict; use warnings; my $resfile = shift; my $csafile = shift; open my $RESFILE, '<', $resfile or die "unable to open $resfile: $!\n" +; my %hashlookup; while ( <$RESFILE> ) { my ( undef, $num, $str ) = split; $hashlookup{ substr( $str, 0, 5 ) . " $num" } = 1; } close $RESFILE; open my $CSAFILE, '<', $csafile or die "unable to open $csafile: $!\n" +; while ( <$CSAFILE> ) { chomp; my ( $pdb, $chain, $csanum ) = ( split /,/ )[ 0, 3, 4 ]; my $key = "$pdb$chain $csanum"; print "$key\n" if $hashlookup{ $key }; } close $CSAFILE;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found