http://www.perlmonks.org?node_id=670550


in reply to File slurping into $text and then accessing a specific line?

If you want to access a line by its number, you might be interested in using Tie::File.