Advertisement
Googleinurl

Script PERL Extrair emails

Sep 4th, 2012
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.44 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #Fonte: http://madeinbrazil.umforum.net/t6120-perl-email-extractor
  3.  
  4. use strict;
  5. use warnings;
  6. use feature 'say';
  7.  
  8.  
  9. sub entrada()
  10. {
  11.     system(($^O == 'linux') ? 'reset':'cls');
  12.     open(my $arq,$ARGV[0]) || die "[-] $!.\n" if (defined($ARGV[0]) || die "[-] Parâmetro inválido.\n");
  13.     while(<$arq>)
  14.     {
  15.         chomp;
  16.         say $1 if  m/([\w]+\@[\w\.]+)/sg;        
  17.     };  
  18.     close($arq);  
  19. }
  20.  
  21.  
  22. &entrada();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement