in reply to Net::LDAP GUID...

Search http://search.cpan.org for GUID and for UUID.

Replies are listed 'Best First'.
Re^2: Net::LDAP GUID...
by Anonymous Monk on May 03, 2012 at 18:30 UTC
    sub GuidToString
    {
        my $stringGUID = unpack("H*", shift);
        $stringGUID =~ s/^(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w\w\w)}/$4$3$2$1-$6$5-$8$7-$9-/;
        return $stringGUID;
    }
    
      I like the GuidToString sub but the extra curly brace was a little tough to find. This works great. sub GuidToString { my $stringGUID = unpack("H*", shift); $stringGUID =~ s/^(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w)(\w\w\w\w)/$4$3$2$1-$6$5-$8$7-$9-/; return $stringGUID; } Thanks,