Since it's a perl forum, and not a sed forum. Here is a possible way to do it for other readers coming around.
#!/usr/bin/perl -w
use IO::File;
my $fh = IO::File->new('ips.txt','r');
die 'ips.txt: ' . $! unless($fh && $fh->opened);
while (my $line = $fh->getline) {
chomp($line);
print $line . " 0\n";
}
$fh->close;
unlink('ips.txt');
Here's a 1-liner:
cat ips.txt | perl -pe 's/[\r\n]+$/ 0\n/sg;s/ +/ /sg;'