for (keys %codes_hash) {
print "$_|$codes_hash{$_}\n";
}for my own confirmation, I'm getting a blank line in the printout. I re-checked my config file and made sure there was not an extra blank line at the end of the file. Do you have any ideas why it would print out a blank line?
Here's my entire test code:
my $test_file = "test.codes"; my %codes_hash = ();
open (TEST,"< $test_file") or die "Cannot open $test_file";
while (<TEST>) {
my ($code, $id) = split /\|/;
$codes_hash{$code} = $id;
}for (keys %codes_hash) {
print "$_|$codes_hash{$_}\n";
}> If you only need two fields, it's more efficient to assign split() to
> a list.
>
> my ($key, $value) = split /\|/; $alpha_hash{$key} = $value;
>
> The split() operator is clever/lazy enough to notice that you only
> need the first two chunks, and it does the least amount of work
> necessary to provide them.
>
> (Roughly speaking, it does "split /\|/, $_, 3".)-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
