Posted on 2008-11-07 18:49:55-08 by someguy
Output format syntax
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!
Direct Responses: 9274 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.