in reply to Re^6: Key value pair in hash inside while loop
in thread Key value pair in hash inside while loop

Change

$pos = (split /\s+/)[0];

to

$pos = (split /\s+/, $ctline)[0];