I have a feeling that you are not using strict. Use it, make your code work with it, e.g., use 'foreach my $entry (@GILIST) {...', and see if your problem becomes apparent. If it does not become apparent, at least problems will be easier to find (for all of us).