This is an easy question, but I just can't seem to find the answer. How can I do this substitution in a single line?
I tried the following, but all it does is return the number of substitutions that were made...
Thanks
Code:
$str = 'alpha.txt';
$new = $str;
$new =~ s/txt$/pol/;
Code:
$new = ($str =~ s/txt$/pol/;
Thanks