I'm triyng to extract some url, it can be more than one, that come in a body email.
And i'm trying to parse the urls, with this:
use strict;
use warnings;
use Net::IMAP::Simple;
use Email::Simple;
use IO::Socket::SSL;
# here must be the connection to imap hidden for economize space
my $es = Email::Simple->new( join '', @{ $imap->get($i) } );
my $text = $es->body;
print $text;
my $matches = ($text =~/<a[^>]*href="([^"]*)"[^>]*>.*<\/a>/);
print $matches;
On $text i have the next text:
--047d7b47229eb3d9f404e58fd90a
Content-Type: text/plain; charset=ISO-8859-1
Try1 <http://www.washingtonpost.com/>
Try2 <http://www.thesun.co.uk/sol/homepage/>
--047d7b47229eb3d9f404e58fd90a
Content-Type: text/html; charset=ISO-8859-1
<div dir="ltr"><a href="http://www.washingtonpost.com/">Try1</a><br><div><br></div><div><a href="http://www.thesun.co.uk/sol/homepage/">Try2</a><br></div></div>
--047d7b47229eb3d9f404e58fd90a--
The output of the program, gives me a 1
... just that.
Anyone can help??
Thanks in advice.