Maybe that is what you are looking for:
Code:
# data
$original_string = "33445566";
# test
my $result_string = my_convert($original_string);
print $result_string;
# the function for string modification
sub my_convert(){
my $var = shift;
my $new_str = "";
foreach ( $var =~ /.{2}/sg){
$new_str .= "0x$_,";
Leave a comment: