in reply to Multi line file to variables

See perlintro. The following is almost entirely copied from that page, I've just added the chomp to remove the newlines and customized the print:

#!/usr/bin/env perl use strict; use warnings; open(my $in, "<", "input.txt") or die "Can't open input.txt: $!"; chomp( my @lines = <$in> ); close $in or die "$in: $!"; print "Line 1: $lines[0]\n"; print "Line 2: $lines[1]\n";