in reply to Re^2: How to ignore special characters in a variable ?
in thread How to ignore special characters in a variable ?
\Q is quotemeta, so I don't see how it could be better.
>perl -MO=Concise,-exec -e"qq{\Q$x}" 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <#> gvsv[*x] s 4 <1> quotemeta[t2] sK/1 5 <@> stringify[t3] vK/1 6 <@> leave[1 ref] vKP/REFC -e syntax OK >perl -MO=Concise,-exec -e"quotemeta($x)" 1 <0> enter 2 <;> nextstate(main 1 -e:1) v:{ 3 <#> gvsv[*x] s 4 <1> quotemeta[t2] vK/1 5 <@> leave[1 ref] vKP/REFC -e syntax OK
If you're just talking about how it looks in the code, ok.
|
|---|