B
BDK
I am trying to take a peice of a word and replace it with output of
the chr function. So the word is ki45. I want to replace the 45 with
what "print (chr(36));" returns.
Here is what I have tried:
$word = ki45;
$word =~ s/(45)/(print (chr(chr36))/;
print ($word);
print "\n";
but that returns:
ki(print (chr(chr36))
I have also tried:
$test = print (chr(chr36);
$word = ki45;
$word =~ s/(45)/$test/;
print ($word);
print "\n";
but that returns this:
ki1
I'm assuming the 1 is "true", but I want the output which should be $.
Any help would be greatly appreciated. Thanks.
the chr function. So the word is ki45. I want to replace the 45 with
what "print (chr(36));" returns.
Here is what I have tried:
$word = ki45;
$word =~ s/(45)/(print (chr(chr36))/;
print ($word);
print "\n";
but that returns:
ki(print (chr(chr36))
I have also tried:
$test = print (chr(chr36);
$word = ki45;
$word =~ s/(45)/$test/;
print ($word);
print "\n";
but that returns this:
ki1
I'm assuming the 1 is "true", but I want the output which should be $.
Any help would be greatly appreciated. Thanks.