in reply to Re^4: Splitting a long row with multiple delimiters.
in thread Splitting a long row with multiple delimiters.

$rec{$key} = $value if defined $key; $key = $newkey; print "KEY = $key, VALUE = $value\n";
put that print statement one line earlier, like this:
$rec{$key} = $value if defined $key; print "KEY = $key, VALUE = $value\n"; $key = $newkey;