Data::GUID - globally unique identifiers
version 0.00
$Id: /my/cs/projects/guid/trunk/lib/Data/GUID.pm 19169 2006-02-25T22:24:28.475209Z rjbs $
use Data::GUID; my $guid = Data::GUID->new; my $string = $guid->as_string; # or "$guid" my $other_guid = Data::GUID->from_string($string); if (($guid <=> $other_guid) == 0) { print "They're the same!\n"; }
Data::GUID provides a simple interface for generating and using globally unique identifiers.
new
my $guid = Data::GUID->new;
This method returns a new globally unique identifier.
These method returns a new Data::GUID object for the given GUID value.
from_string
my $guid = Data::GUID->from_string("B0470602-A64B-11DA-8632-93EBF1C0E05A");
from_hex
# note that a hex value is a string with out hyphens and with a leading 0x my $guid = Data::GUID->from_string("0xB0470602A64B11DA863293EBF1C0E05A");
from_base64
my $guid = Data::GUID->from_string("sEcGAqZLEdqGMpPr8cDgWg==");
These methods return string representations of a GUID.
as_string
This method is also used to stringify Data::GUID objects.
as_hex
as_base64
as_binary
This method returns the packed binary representation of the GUID.
compare_to_guid
This method compares a GUID to another GUID and returns -1, 0, or 1, as do other comparison routines.
Ricardo SIGNES, <rjbs@cpan.org>
<rjbs@cpan.org>
add namespace support
remove dependency on wretched Data::UUID
Please report any bugs or feature requests to bug-data-guid@rt.cpan.org, or 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.
bug-data-guid@rt.cpan.org
Copyright 2006 Ricardo Signes, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::GUID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::GUID
CPAN shell
perl -MCPAN -e shell install Data::GUID
For more information on module installation, please visit the detailed CPAN module installation guide.