in reply to Putting text file into a hash

Define "doesn't seem to work". If you change the chomp line to chomp $line; then the code works as I would expect.

For sample code adding sample data in a __DATA__ section after your code and using <DATA> for your file handle makes it easier for us to reproduce your problem.


Perl reduces RSI - it saves typing