Email-Find

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

          use Email::Find;

          # Simply print out all the addresses found leaving the text undisturbed.
          my $finder = Email::Find->new(sub {
                                            my($email, $orig_email) = @_;
                                            print "Found ".$email->format."\n";
                                            return $orig_email;
                                        });
          $finder->find(\$text);

          # For each email found, ping its host to see if its alive.
          require Net::Ping;
          $ping = Net::Ping->new;
          my %Pinged = ();
          my $finder = Email::Find->new(sub {
                                            my($email, $orig_email) = @_;
                                            my $host = $email->host;
                                            next if exists $Pinged{$host};
                                            $Pinged{$host} = $ping->ping($host);
                                        });

lib/Email/Find.pm  view on Meta::CPAN

  use Email::Find;

  # Simply print out all the addresses found leaving the text undisturbed.
  my $finder = Email::Find->new(sub {
				    my($email, $orig_email) = @_;
				    print "Found ".$email->format."\n";
				    return $orig_email;
				});
  $finder->find(\$text);

  # For each email found, ping its host to see if its alive.
  require Net::Ping;
  $ping = Net::Ping->new;
  my %Pinged = ();
  my $finder = Email::Find->new(sub {
  				    my($email, $orig_email) = @_;
  				    my $host = $email->host;
  				    next if exists $Pinged{$host};
  				    $Pinged{$host} = $ping->ping($host);
  				});



( run in 1.461 second using v1.01-cache-2.11-cpan-39bf76dae61 )