Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Possible unintended interpolation of @$ in string (http://www.velocityreviews.com/forums/t910359-possible-unintended-interpolation-of-in-string.html)

jidanni@jidanni.org 04-29-2009 02:38 AM

Possible unintended interpolation of @$ in string
 
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.

derykus@gmail.com 04-29-2009 03:41 AM

Re: Possible unintended interpolation of @$ in string
 
On Apr 28, 7:38*pm, jida...@jidanni.org wrote:
> Perl warns here,
> $ echo o|perl -plwe 's/./@@@@$&/'

^^^^^
-Mdiagnostics -plwe

> Possible unintended interpolation of @$ in string at -e line 1.
> @@@&


--
Charles DeRykus


smallpond 04-29-2009 05:32 PM

Re: Possible unintended interpolation of @$ in string
 
On Apr 28, 10:38 pm, jida...@jidanni.org wrote:
> 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


All times are GMT. The time now is 04:21 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.