Do you know where your variables are? | |
PerlMonks |
Re: Using the result of s///by elusion (Curate) |
on Apr 30, 2003 at 20:15 UTC ( [id://254449]=note: print w/replies, xml ) | Need Help?? |
The first example you give prints the result of the substitution (the result of $string =~ s/_/ /g). If you look at the documentation for s///, you will see that it returns the number of substitutions made. It's easier to see in code.
That's what the first result is equal to. The second example prints the new $string, which is what you want in this case. elusion : http://matt.diephouse.com
In Section
Seekers of Perl Wisdom
|
|