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

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top