my @files = qw(file1 file2 file3); my @contents; foreach (@files} { open FILE, $_ or do { warn "Can't open $_: $!\n"; next } local $/; push @contents, ; } #### my @files = qw(file1 file2 file3); my @contents; foreach (@files} { open FILE, $_ or do { warn "Can't open $_: $!\n"; next } push @contents, []; }