push(@abst_listing,$abstracts[1]); #### # at the top of your script: use Data::Dumper; ... my $a; my $b; my $c; # *** find out what the contents of your arrays is print Dumper(\@abst_listing,\@cont_names,\@bact_names); for ($a=0; $a<= scalar(@abst_listing); $a++){ for ($c=0; $c<= scalar(@cont_names); $c++){