in reply to Re^3: using s/ to not only substitute but also modify text
in thread using s/ to not only substitute but also modify text
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 $_
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: using s/ to not only substitute but also modify text
by ikegami (Patriarch) on Nov 23, 2008 at 01:35 UTC | |
by Anonymous Monk on Nov 23, 2008 at 03:55 UTC |