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.
In reply to Re: Putting text file into a hash
by GrandFather
in thread Putting text file into a hash
by remluvr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |