in reply to Removing digits until you see | in a string

Yet another way:
$str =~ s/^(\d+)// or die "missing digits in front of $str\n"; $data_hash{$1} = $str;