I'm having a little difficulty with formatting some output. I'm new to perl, so maybe there is a simple fix. My script contains the following code snipet:
$np->callback ( \&yeeha );
$np->parsefile($xml_file);
sub yeeha
{
my $host = shift; #Nmap::Parser::Host object, just parsed
print $host->addr,":",$host->tcp_ports('open'),"\n";
}
which returns something like this:
192.168.1.2:251351394452105
and I'd like to to look like this:
192.168.1.2:25
192.168.1.2:135
192.168.1.2:139
192.168.1.2:445
192.168.1.2:2105
Anybody have any ideas how I can produce this output? If I can't get to this output directly I wouldn't even mind if I had to go through a few steps (bash or otherwise). Thanks to anyone who can help!