LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl Module ManPages (https://www.linuxquestions.org/questions/programming-9/perl-module-manpages-4175422483/)

metallica1973 08-16-2012 03:38 PM

Perl Module ManPages
 
I consider myself a true novice of Perl and wanted to know how one may find what functions/commands each perl module contains. I am tired of going to

http://search.cpan.org/~maxschube/Nm...ner/Scanner.pm

and reading through stuff and alot of times they dont go over all the functions that the module may contain. An example "get_host_list,get_next,hostname":

Code:

  use Nmap::Scanner;
  my $scan = Nmap::Scanner->new();
 
  $scan->add_target('localhost');
  $scan->add_target('host.i.administer');
  $scan->add_scan_port('1-1024');
  $scan->add_scan_port('31337');
  $scan->tcp_syn_scan();
  $scan->noping();
 
  my $results = $scan->scan();
 
  my $hosts = $results->gethostlist();
 
  while (my $host = $hosts->get_next()) {
 
      print "On " . $host->hostname() . ": \n";
 
      my $ports = $host->get_port_list();
 
      while (my $port = $ports->get_next()) {
          print join(' ',
              'Port',
              $port->service() . '/' . $port->portid(),
              'is in state',
              $port->state(),
              "\n"
          );
      }
 
  }

its a bit confusing. Any help would be most appriciated.

kbp 08-16-2012 07:08 PM

I believe most modules will include man pages, try running man for the module you've imported:

Code:

man 3 Date::Format

theNbomr 08-16-2012 07:45 PM

Perhaps you didn't know about perldoc. Mostly I use the functions manpages with the -f option, like so:
Code:

perldoc -f split
--- rod.

piyush.sharma 08-17-2012 12:18 AM

things are written in man page of perl, try
man perl
and find specific content from list and then try
man content-name

metallica1973 08-17-2012 09:22 AM

Many thanks


All times are GMT -5. The time now is 10:43 PM.