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
In reply to Re: Array values into hash
by Enlil
in thread Array values into hash
by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |