I'm trying to parse an email address and I can't seem to get Email::Address to work quite.
#!/usr/bin/perl
use strict; use warnings ; use Email::Address ;
my $addr = "My Name <myname\@verizon.net>\n" ; my @addrs = Email::Address::parse($addr) ; warn scalar(@addrs) ;
Gets me "0" -- it appears not to parse that string, which certainly looks like a legal email addr to me [am I missing some problem with it?? -- I actually pulled it out of a file of addresses that sendmail is happily sending-via]. What am I missing here? THANKS!
/bernie\ -- Bernie Cosell Fantasy Farm Fibers ber...@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <--
In article <aahr24dpblvs36fuh7ja9gvdhavod3k...@library.airnews.net>,
Bernie Cosell <ber...@fantasyfarm.com> wrote: > I'm trying to parse an email address and I can't seem to get Email::Address > to work quite.
You are not calling parse() correctly.
> #!/usr/bin/perl
> use strict; > use warnings ; > use Email::Address ;
> my $addr = "My Name <myname\@verizon.net>\n" ; > my @addrs = Email::Address::parse($addr) ;
my @addrs = Email::Address->parse($addr);
> warn scalar(@addrs) ;
> Gets me "0" -- it appears not to parse that string, which certainly looks > like a legal email addr to me [am I missing some problem with it?? -- I > actually pulled it out of a file of addresses that sendmail is happily > sending-via]. What am I missing here? THANKS!
perldoc Email::Address
-- Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- http://www.usenet.com
On May 16, 3:08 pm, "comp.llang.perl.moderated" <c...@blv-
sam-01.ca.boeing.com> wrote: > On May 16, 10:37 am, Bernie Cosell <ber...@fantasyfarm.com> wrote:> I'm trying to parse an email address and I can't seem to get Email::Address > > to work quite.
> > #!/usr/bin/perl
> > use strict; > > use warnings ; > > use Email::Address ;
> > my $addr = "My Name <myname\@verizon.net>\n" ; > > my @addrs = Email::Address::parse($addr) ;
Thanks! Total brain cramp... I _thought_ I had cut/pasted the call to parse from the E::A man page but obviously I screwed up bigtime [and it was one of those dumbnesses that after-the-fact you can't see in your own code]. THANKS!!