XML::FOAF::Emailaddress - OOP for handling FOAF email addresses.
# Note the single quotes
my $email = XML::FOAF::Emailaddress->new('foo@bar.com'); print "My email address SHA-ed is $email\n";
This is little more than an OOP-ifying of existing code that's already been written for generating SHA1 hashes for email addresses.
I wrote it because I am punch drunk on using the Perl overload hooks -- which in this case overloads the '' operator to return the garbled email address -- and because I can never remember how to actually handle email addresses in FOAF.
Presumably, I can now safely forget altogether.
new($emailaddress)
If no address id defined, defaults to someone@example.com
sha1()
Returns a SHA1 hash for the object's email address.
address()
Returns the object's email address.
1.0
$Date: 2003/04/08 13:52:36 $
Aaron Straup Cope
http://www.w3.org/2001/sw/Europe/200303/geo/PerlSha1.pl
http://london.pm.org/~jo/foaf.pl.txt
Copyright (c) 2003, Aaron Straup Cope. All Rights Reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.