my $myfile='path_to_my_file'; open my $fh, '<', $myfile or die $!; my @myarray=<$myfile>; close $fh;