Possible unintended interpolation of @$ in string

J

jidanni

Perl warns here,
$ echo o|perl -plwe 's/./@@@@$&/'
Possible unintended interpolation of @$ in string at -e line 1.
@@@&
Perhaps it should also warn here:
$ echo o|perl -plwe 's/(.)/@@@@$1/'
@@@

If so please submit a bug for me, because my address is blocked from
perl.org.
 
S

smallpond

Perl warns here,
$ echo o|perl -plwe 's/./@@@@$&/'
Possible unintended interpolation of @$ in string at -e line 1.
@@@&
Perhaps it should also warn here:
$ echo o|perl -plwe 's/(.)/@@@@$1/'
@@@

If so please submit a bug for me, because my address is blocked from
perl.org.

I don't know how perl could be expected to know what was intended.
@$ seems to be cromulent.

perl -we '$$[0]="That is"; $$[1]="messed up"; print join " ",@$'
That is messed up
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top