in reply to Example of push

There are a few things that may be causing problems. You have
if (@txtfile[$i] =~ /\b- skipped/) { chomp ($errout = @txtfile[$i]); push(@outfile,$errout); }
Other than that, the code looks good. If you are still having problems after fixing these things, perhaps you can reply and show us where @txtfile is getting assigned values, and where @outfile is getting used and someone can see what's wrong.