in reply to surprised to find cannot assign s/../../ to a variable
For storing complex code use a subroutine.
DB<6> sub repl { $_[0] =~ s/a/b/ } DB<7> p $a aa DB<8> repl $a DB<9> p $a ba
Tho your motivation is unclear for me , smells like an XY problem
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: surprised to find cannot assign s/../../ to a variable
by vincentaxhe (Scribe) on Jul 05, 2024 at 13:08 UTC | |
by Danny (Chaplain) on Jul 05, 2024 at 13:31 UTC | |
by hippo (Archbishop) on Jul 05, 2024 at 13:40 UTC | |
by vincentaxhe (Scribe) on Jul 05, 2024 at 15:27 UTC | |
by hippo (Archbishop) on Jul 05, 2024 at 15:45 UTC | |
by LanX (Saint) on Jul 06, 2024 at 13:04 UTC |