in reply to Checking Hash contents
If you'd rather just log it as the file is read you can get rid of the foreach and move the print statement back inside the while.my %values; while (<INFILE>){ chomp; next unless (/\t/); my ($key, $value ) = split(/\t/, $_, 2); $values{$key}=$value; } foreach my $key (sort keys %values) { print OUTPUT "$key: $values{$key}\n"; }
|
|---|