In the first case, you print the return value from the substitution. In the second, you print the string the substitution was performed on.
The return from s// is a fairly complex matter which depends on context, the /g option, and whether backreference capturing is attempted. See perlop and perlre for details.
After Compline,
Zaxo
In reply to Re: Using the result of s///
by Zaxo
in thread Using the result of s///
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |