http://www.perlmonks.org?node_id=991509


in reply to BOTH STOUT and STDERR to same file.

system("/home/me/ipinfo.pl $_ >$output 2>&1");
This will overwrite output file in while loop.
What if you append the output?
system("/home/me/ipinfo.pl $_ >> $output 2>&1");