in reply to Re: Perl Code Runs Extremely Slow
in thread Perl Code Runs Extremely Slow
A few minor problems with your code. Here's my idea of a better version (update: starting from the second verse).
open IHF, "<", "File1" or die "Could not open File1: $!"; while( <IHF> ) { chomp; my ($k, $v) = split; $fets{$k} = $v if defined ($k) and defined ($v); } close IHF; open JHF, "<", "File2" or die "Could not open File2: $!"; while(<JHF>) { chomp; my ($key, $val) = split; print "$key $fets{$key} $val\n" if exists $fets{$key}; } close JHF;
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Code Runs Extremely Slow
by Mandrake (Chaplain) on Jun 14, 2006 at 08:15 UTC | |
by jwkrahn (Abbot) on Jun 14, 2006 at 12:10 UTC | |
by jeffa (Bishop) on Jun 15, 2006 at 20:11 UTC |