use File::Slurp; my @file1 = read_file('file1'); my @file2 = read_file('file2');