in reply to Messing with hashes

Here's a regex solution, just for the hell of it.
$line = 'key1|value1|key2|value2|'; while ( $line =~ m/([^|]+)\|([^|]+)\|/g ){ $file{$1}=$2; }
And another note -- are all the keys unique? Because later ones will over-write earlier ones if they're not...
--
“Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
M-J D