Query: data::guid
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Data::GUID(3pm) User Contributed Perl Documentation Data::GUID(3pm)NAMEData::GUID - globally unique identifiersVERSIONversion 0.046SYNOPSISuse 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! "; }DESCRIPTIONData::GUID provides a simple interface for generating and using globally unique identifiers.GETTING A NEW GUIDnew my $guid = Data::GUID->new; This method returns a new globally unique identifier.GUIDS FROM EXISTING VALUESThese method returns a new Data::GUID object for the given GUID value. In all cases, these methods throw an exception if given invalid input. from_string my $guid = Data::GUID->from_string("B0470602-A64B-11DA-8632-93EBF1C0E05A"); from_hex # note that a hex guid is a guid string without hyphens and with a leading 0x my $guid = Data::GUID->from_hex("0xB0470602A64B11DA863293EBF1C0E05A"); from_base64 my $guid = Data::GUID->from_base64("sEcGAqZLEdqGMpPr8cDgWg=="); from_data_uuid This method returns a new Data::GUID object if given a Data::UUID value. Because Data::UUID values are not blessed and because Data::UUID provides no validation method, this method will only throw an exception if the given data is of the wrong size.IDENTIFYING GUIDSstring_guid_regex hex_guid_regex base64_guid_regex These methods return regex objects that match regex strings of the appropriate type. from_any_string my $string = get_string_from_ether; my $guid = Data::GUID->from_any_string($string); This method returns a Data::GUID object for the given string, trying all known string interpretations. An exception is thrown if the value is not a valid GUID string. best_guess my $value = get_value_from_ether; my $guid = Data::GUID->best_guess($value); This method returns a Data::GUID object for the given value, trying everything it can. It works like "from_any_string", but will also accept Data::UUID values. (In effect, this means that any sixteen byte value is acceptable.)GUIDS INTO STRINGSThese methods return various string representations of a GUID. as_string This method returns a "traditional" GUID/UUID string representation. This is five hexadecimal strings, delimited by hyphens. For example: B0470602-A64B-11DA-8632-93EBF1C0E05A This method is also used to stringify Data::GUID objects. as_hex This method returns a plain hexadecimal representation of the GUID, with a leading "0x". For example: 0xB0470602A64B11DA863293EBF1C0E05A as_base64 This method returns a base-64 string representation of the GUID. For example: sEcGAqZLEdqGMpPr8cDgWg==OTHER METHODScompare_to_guid This method compares a GUID to another GUID and returns -1, 0, or 1, as do other comparison routines. as_binary This method returns the packed binary representation of the GUID. At present this method relies on Data::GUID's underlying use of Data::UUID. It is not guaranteed to continue to work the same way, or at all. Caveat invocator.IMPORTINGData::GUID does not export any subroutines by default, but it provides a few routines which will be imported on request. These routines may be called as class methods, or may be imported to be called as subroutines. Calling them by fully qualified name is incorrect. use Data::GUID qw(guid); my $guid = guid; # OK my $guid = Data::GUID->guid; # OK my $guid = Data::GUID::guid; # NOT OK guid This routine returns a new Data::GUID object. guid_string This returns the string representation of a new GUID. guid_hex This returns the hex representation of a new GUID. guid_base64 This returns the base64 representation of a new GUID. guid_from_anything This returns the result of calling the "from_any_string" method.TODOo add namespace support o remove dependency on wretched Data::UUID o make it work on 5.005AUTHORRicardo SIGNES, "<rjbs@cpan.org>"BUGSPlease 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.COPYRIGHTCopyright 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. perl v5.14.2 2011-01-18 Data::GUID(3pm)
Related Man Pages |
---|
dpns_statr(3) - debian |
lfc_perl(3) - debian |
ibtracert(8) - debian |
vendstat(8) - debian |
data::guid(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
what is SUID/GUID bits in UNIX/Solaris |
Data after a string in a file |
what is SUID,GUID and Sticky bit? |
what is SUID,GUID and Sticky bit? |
How to allocate memory to a string in C? |