function hex2bin{ my $data=shift; my $newdata=''; while($data){ $newdata .= pack("C",hex(substr($data,0,2,''))) } return $newdata; }