in reply to scalar values from split

Firstly you need to chomp your input. Secondly, | is regexp-magical. You need to escape it with a backslash in your split.

Also, you want to mention the name of the file that you fail to open in you open's die clause. That will help in the future. And instead of hardcoding it, you should say something like

my $file = shift || 'c:/items.pl';
and then pass $file to your open statement. That way you can run it on a different data file without having to edit your script.

And I see no race conditions!

--
g r i n d e r
print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u';