in reply to How to generate UUID for DocumentID and InstanceID

According to the Data::UUID documentation:
use Data::UUID; $ug = new Data::UUID; $uuid1 = $ug->create(); $uuid2 = $ug->create_from_name(<namespace>, <name>);
Does this work for you? If not, what error message do you get?

Replies are listed 'Best First'.
Re^2: How to generate UUID for DocumentID and InstanceID
by srikrishnan (Beadle) on Dec 09, 2008 at 04:39 UTC
    Hi,

    I am trying something like below:

    use Data::UUID;
    my $ug = new Data::UUID;

    my $PDFpath = "C:\\XMP_Metadata\\Sample.pdf";
    my $DocIDVal = $ug->create_from_name_str(<namespace>, "$PDFpath");
    print "$DocIDVal\n";

    But in the above script, I dont know what namespace I have to use for pdf files, also I dont know how to generate two different UUIDs for DocumentID and InstanceID?

    In the Module they have specified only the four namespaces:

    NameSpace_DNS
    NameSpace_URL
    NameSpace_OID
    NameSpace_X500

    Thanks,
    Srikrishnan

      You need to choose a namespace for your application. The purpose of the namespace is to separate your UUIDs from everyone else's.

      One possibility would be to declare two different namespaces, one for document IDs and one for instance IDs. Then use the appropriate namespace for the ID you want to generate. The important point is that the IDs should be different for different objects.

      On a side note, the quotes in "$PDFpath" serve no purpose and should probably be removed. $PDFpath is already a string.

      G. Wade