in reply to Port Java code to Perl help

Perhaps:

sub dashedHexToBytes{ join'', map pack( 'H*', $_ ),split'-', $_[0] };;
print dashedHexToBytes( '3f-ff0c-1234-af12' );;
? ♀↕4»↕

Or

sub dashedHexToBytes{ local $_ = shift; tr[-][]; return pack( 'h*', $_ ); };;
print dashedHexToBytes( '0123-4567-89ab-cdef-0123-4567-89ab-cdef' );;
►2MeÎÿ║═Ý▀►2MeÎÿ║═Ý☼

Note: In both examples, you may need to switch from 'H*' to 'h*' or vice versa depending on the endianess of the originating system and that of the receiving system.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: Port Java code to Perl help
by jaakko_m (Initiate) on Apr 23, 2012 at 03:55 UTC
    This solution did the trick, got the result into a binary exactly as we needed! Thanks so much and sorry for the delay in getting my response back up here.
    sub dashedHexToBytes{ join'', map pack( 'H*', $_ ),split'-', $_[0] };
    Best! Jaakko