my $hexstring = join " ", map { sprintf("0x%04x",ord()) } split //, $foobar_string;