my $hex = 'E1B4FF'; my ($x1,$x2,$x3)=map{ hex }unpack('(A2)*',$hex ); print $x1 . $x2 . $x3 . "\n";