foreach my $fid(@fileid) { print "$fid "; ##Shows e.g. 1 1 9 4 8 5 6 0 } #### for (my $i=0; $i