in reply to How to read from a .txt

Your Perl script runs fine for me. Don't change anything. Use it exactly as it is.