macubergeek
IS-IT--Management
Hi all
I'm trying to write a script using the above perl module and am having difficulties. I'm trying to read a file "combined.nbe" into array @mynessusdata then parse it using this perl module.
----------------my code-------------------
#!/usr/bin/perl
open(DAT, "/Users/jamesk/Desktop/combined.nbe") || die("Could not open file!");
my @nessusdata=<DAT>;
close DAT;
my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;
----------------/my code------------------
I'm getting:
Undefined subroutine &main::nports called at ./testme3 line 7.
I was hoping someone could point out where I've screwed this up. The perl docs for this module has this:
To query by port
my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;
# returns
IP|specified port
# example
192.168.0.5|ssh (22/tcp)
192.168.0.6|ssh (22/tcp)
192.168.0.8|ssh (22/tcp)
192.168.0.23|ssh (22/tcp)
192.168.0.89|ssh (22/tcp)
...
I'm trying to write a script using the above perl module and am having difficulties. I'm trying to read a file "combined.nbe" into array @mynessusdata then parse it using this perl module.
----------------my code-------------------
#!/usr/bin/perl
open(DAT, "/Users/jamesk/Desktop/combined.nbe") || die("Could not open file!");
my @nessusdata=<DAT>;
close DAT;
my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;
----------------/my code------------------
I'm getting:
Undefined subroutine &main::nports called at ./testme3 line 7.
I was hoping someone could point out where I've screwed this up. The perl docs for this module has this:
To query by port
my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;
# returns
IP|specified port
# example
192.168.0.5|ssh (22/tcp)
192.168.0.6|ssh (22/tcp)
192.168.0.8|ssh (22/tcp)
192.168.0.23|ssh (22/tcp)
192.168.0.89|ssh (22/tcp)
...