sub openf{ my $file = shift; open(FH,$file) ||die"There's a problem! Here's what's up: $!"; my @array = ; close FH ||die"There's a problem! Here's what's up: $!"; @array=grep{$_ ne ""} @array; return @array; } push @array,openf("test2.txt"),openf("test.txt"); print $array[4];