in reply to Re^2: extracting name & email address
in thread extracting name & email address
The following code works to a point. It is writing name and email address out to a file. The only real problem is the msg "Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/Email/Address.pm line 108."
#!/usr/bin/env perl # use strict; use warnings; use File::Find; use File::Slurp qw( read_file ); use Email::Address; my $directory = '/home/*****/Mail/.family.directory/Browne, Bill & Ma+ +rtha';'; my $outfile = 'output.txt'; my @found_files; find( sub { push @found_files, $File::Find::name }, $directory ); foreach(@found_files){ my $file = "$_"; if (-f $file) { print $_,"\n"; my $intext = File::Slurp::read_file( $file ); my @emails = Email::Address->parse( $intext ); File::Slurp::write_file( $outfile, {append => 1 }, join("\n", @ema +ils) ); } }
The file that the warning msg appears has a large attachment. So, somehow need to bypass any attachments in the slurp ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: extracting name & email address
by peterr (Scribe) on Feb 24, 2015 at 03:24 UTC | |
by Anonymous Monk on Feb 24, 2015 at 03:33 UTC | |
by peterr (Scribe) on Feb 24, 2015 at 04:43 UTC | |
by peterr (Scribe) on Feb 24, 2015 at 23:42 UTC | |
by peterr (Scribe) on Feb 25, 2015 at 00:07 UTC | |
by peterr (Scribe) on Feb 25, 2015 at 02:34 UTC | |
by peterr (Scribe) on Mar 04, 2015 at 00:21 UTC | |
|