in reply to Array values into hash
use strict; use warnings; #grabs the line splits it into two parts and #puts in hash my %hash = map { (split /\|/,$_)[0,1] } <DATA>; #print the hash foreach (keys %hash) { print "$_, $hash{$_}",$/;} __DATA__ key1|value1| key2|value2| key3|value3|
-enlil
|
|---|