in reply to Array values into hash

this should work...

#!/usr/bin/perl use warnings; use strict; my (@lines,%hash); open (IN,"<data.txt") or die "cannot open file for reading: $!"; @lines = <IN>; close (IN) or die "cannot close file: $!"; foreach (@lines) { $_ =~ /(.*)\|(.*)\|/; $hash{$1} = $2; }