in reply to Re: Net::LDAP GUID...
in thread Net::LDAP GUID...

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;
}

Replies are listed 'Best First'.
Re^3: Net::LDAP GUID...
by Anonymous Monk on Feb 03, 2015 at 21:32 UTC
    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,