All pastes #175140 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-18 14:54 UTC
rendered paste body
#!/usr/bin/perl

use Email::Valid;
use Mail::Address qw/phrase address/;
use Scalar::Util;

my $addr = 'John Doe <jdoe@example.com>';
my @a = Email::Valid->address($addr);

print "address: $addr\n";
for my $i (@a) {
print "blessed: ".Scalar::Util::blessed($i)."\n";
print "phrase: ".$i->phrase()."\n";
}
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"foo.pl" 14 lines, 313 characters
[10:53am pony] ./foo.pl
address: John Doe <jdoe@example.com>
blessed:
Can't locate object method "phrase" via package "jdoe@example.com" (perhaps you forgot to load "jdoe@example.com"?) at ./foo.pl line 13.