#!/usr/bin/perl open(FILE, "args.test"); @files=; my @allfiles; for my $filename(@files){ open FILE, $filename || die "Cannot open $filename for reading: $!\n"; push @allfiles, ; close FILE; } @test=grep /chr1:8325525/,@allfiles; print "@test\n"; #### print "$array[1],$array2[1],$array3[1],$array4[1]...etc\/n"; #### while(){ chomp; process_into_array($_); } sub process_into_array{ my $file=shift; open(DAT, $file); @file=(); }