in reply to mark end of variable name (e.g.$1)

Use curly braces:
${1}n

Update: But you don't need them for $1n:

$ perl -wE 'say "abc" =~ s/(b)/$1n/r' abnc

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: mark end of variable name (e.g.$1)
by Anonymous Monk on Feb 21, 2023 at 12:04 UTC
    Thanks for your answer !