Well that test script works for me (running as root)
#!/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(0x19a186
+0)' => bless( {
+ 'ports' => {
..snip... 'Nmap::Scanner::P
+ort' ),
...
(I truncated the answer as it's rather too verbose, but rest assured it's showing the port status)
This is using Nmap::Scanner 1.0
# perl -v
This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-li
+nux-gnu-thread-multi
(with 45 registered patches, see perl -V for more detail)
standard perl that comes with Ubuntu 11.10 (64bit)
# nmap -V
Nmap version 5.21 ( http://nmap.org )