in reply to Using the result of s///

In your code
print $string =~ s/_//g
is acutally
my $matches = $string =~ s/_//g; print $matches;
Substitution provides a return value as number of matches. Thus when proceeded by print statement it provides the 'return value' rather than value of the string. When not proceeded by anything, the return value is simply not captured.

artist