in reply to Multi line file to variables

Look at one of the Tutorials here such as "Getting Started with Perl" to get started with Perl programming, and then work out how you think this should work. It is much easier (and more beneficial) to help you fix or improve your code than to just give you the answer.

Consider, too, how you intend to use the data you're reading, and also how you might write this program to solve this particular problem but also be useful for files of more than 2 lines.

1 Peter 4:10