Thanks ikegami. But I still don't understand why I get the error from a script containing the same logic of another, the only difference is that variable being the defaulted $_ while the other is user-defined Eg: my $r Below are the scripts I tested... I'd like to assign a string or even a large body of text to a variable other than $_ Can you help? Thanks.
my $r = "Time to work"; s/work/play/; print $r; #end of script 1 #script 2 $_ = "Time to work"; s/work/play/; print $_
In reply to Re^4: using s/ to not only substitute but also modify text
by Anonymous Monk
in thread using s/ to not only substitute but also modify text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |