| App-Addex documentation | Contained in the App-Addex distribution. |
App::Addex::Entry::EmailAddress - an address book entry's email address
version 0.022
An App::Addex::Entry::EmailAddress object represents, well, an addess for an entry.
my $address = App::Addex::Entry::EmailAddress->new("dude@example.aero");
my $address = App::Addex::Entry::EmailAddress->new(\%arg);
Valid arguments are:
address - the contact's email address
label - the label for this contact (home, work, etc)
there is no guarantee that labels are defined or unique
sends - if true, this address may send mail; default: true
receives - if true, this address may receive mail; default: true
This method returns the email address as a string.
This method returns the address label, if any.
Ricardo SIGNES, <rjbs@cpan.org>
Please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Copyright 2006-2007 Ricardo Signes, all rights reserved.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
| App-Addex documentation | Contained in the App-Addex distribution. |
#!/usr/bin/perl use strict; use warnings; package App::Addex::Entry::EmailAddress;
our $VERSION = '0.022';
sub new { my ($class, $arg) = @_; $arg = { address => $arg } if not ref $arg; undef $arg->{label} if defined $arg->{label} and not length $arg->{label}; for (qw(sends receives)) { $arg->{$_} = 1 unless exists $arg->{$_}; } bless $arg => $class; }
use overload '""' => 'address'; sub address { $_[0]->{address} }
sub label { $_[0]->{label} }
sub sends { $_[0]->{sends} } sub receives { $_[0]->{receives} }
1;