Matteo Cantoni > Net-Scan-Extract-0.03 > Net::Scan::Extract

Download:
Net-Scan-Extract-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.03   Source  

NAME ^

Net::Scan::Extract - Perl module to extract stuff from text.

SYNOPSIS ^

  use Net::Scan::Extract qw( :all );

  my $txtfile = $ARGV[0];
  die "text file?!\n" if !$textfile;

  my @text;
  open(TEXT, "<$txtfile") || die "Error: cannot open the text file: $!\n";
  chomp (@text = <TEXT>);
  close (TEXT);

  my @res = Extract_Email(@text);
  print "\nEmail Address :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Links(@text);
  print "\nHtml Links :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Title(@text);
  print "\nHtml Title :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Comment(@text);
  print "\nHtml Comment :\n";
  print "$_\n" for @res;

  @res = Extract_Phone(@text,"x-xxx-xxx-xxxx");
  print "\nPhone Address :\n";
  print "$_\n" for @res;

  @res = Extract_Ipaddress(@text);
  print "\nIp Address :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Script(@text);
  print "\nHtml Script :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Form(@text);
  print "\nHtml Form :\n";
  print "$_\n" for @res;

  @res = Extract_Html_Hidden(@text);
  print "\nHtml Hidden Form Field :\n";
  print "$_\n" for @res;

  exit(0);

DESCRIPTION ^

Net::Scan::Extract - Perl module to extract stuff from text.

This module allows to extract email address, html comment, html form, html hidden form field, html links, html title, ip address, phone number and html script from text.

Every function returns an array with data extracted like in the example above.

Note: using Extract_Phone function you must specify a phone mask. e.g. x-xxx-xxx-xxxx

SEE ALSO ^

File::Extract, HTML::Extract, HTML::SimpleLinkExtor, Net::IP::Extract

AUTHOR ^

Matteo Cantoni, <matteo.cantoni@nothink.org<gt>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009 by Matteo Cantoni

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.