use File::Slurp; my @lines = read_file("filename", chomp => 1); # will remove newline from each line