Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Is there a simply way to mark the end a variable name like $1 ?
e.g. I want to add a 'n' after the $1:
s/abc(\w+)x/$1.'n'/e; _____ is working.
Is this also possible without the modifier "e" ?
s/abc(\w+)x/$1n/; _____ is not working because "$1" and "n" is merged to "$1n"
The same problem I have at strings: $1."n" is needed for "$1n"
Thanks for your help !!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mark end of variable name (e.g.$1)
by choroba (Cardinal) on Feb 21, 2023 at 08:52 UTC | |
by Anonymous Monk on Feb 21, 2023 at 12:04 UTC | |
|
Re: mark end of variable name (e.g.$1)
by Anonymous Monk on Feb 21, 2023 at 10:30 UTC |