open my $input, '<', 'myfile.txt' or die "cannot open myfile.txt: $!"; my @lines = <$input>;