open (my $filehandle, "<", "text.txt") or die "Problem opening text.txt: $!"; @test = <$filehandle>; close $filehandle; chomp @test;