#!/usr/bin/perl use warnings; use Nmap::Scanner; use Data::Dumper; my $scan = Nmap::Scanner->new(); $scan->add_target('localhost'); $scan->add_scan_port('16310-16316'); $scan->tcp_syn_scan(); my $results = $scan->scan(); print Dumper($results); #### ~# ./test.pl $VAR1 = bless( { 'ALLHOSTS' => { 'Nmap::Scanner::Address=HASH(0x19a1860)' => bless( { 'ports' => { ..snip... 'Nmap::Scanner::Port' ), ... #### # perl -v This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-linux-gnu-thread-multi (with 45 registered patches, see perl -V for more detail) #### # nmap -V Nmap version 5.21 ( http://nmap.org )