in reply to Perl Hex ASCII pack unpack

I presume you're asking how to get the string of 9 bytes that string represents.

$x =~ tr/://d; my $y = pack('H*', $x);
my $y = pack('H*', $x =~ tr/://dr); # 5.14+ required
(my $y = $x) =~ s/([0-9a-fA-F]{2}):?/chr(hex($1))/eg;
my $y = $x =~ s/([0-9a-fA-F]{2}):?/chr(hex($1))/egr; # 5.14+ required
my $y = pack 'C*', map hex, split /:/, $x;
my $y = join '', map chr hex, split /:/, $x;

Replies are listed 'Best First'.
Re^2: Perl Hex ASCII pack unpack
by waytoperl (Beadle) on Sep 26, 2014 at 19:23 UTC

    Thanks