develooper Front page | perl.perl5.porters | Postings from August 2008

Re: [PATCH] Unintented interpolation of $/ in regex (was: Re: [perl #35877] \n after $ in regex (was: Strange regex failure?))

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
August 24, 2008 07:53
Subject:
Re: [PATCH] Unintented interpolation of $/ in regex (was: Re: [perl #35877] \n after $ in regex (was: Strange regex failure?))
Message ID:
b77c1dce0808240752i5d11e654oce8cdf49cbc5d552@mail.gmail.com
2008/7/24 Bram <p5p@perl.wizbit.be>:
> Citeren Yitzchak Scott-Thoennes <sthoenna@efn.org>:
>
>> On Mon, June 2, 2008 1:52 pm, Bram wrote:
>>>
>>> Quoting David Nicol <davidnicol@gmail.com>:
>>>>
>>>> Warn that non-final $ will interpolate in documentation and suggest
>>>> \Z instead?
>>>
>>> Given how easy it is to miss it I feel more for a
>>> 'Possible unintended interpolation of $\ in regex' warning. (if that
>>> is even possible of course)
>>>
>>> Any comments on the warning?
>>
>> Sounds great, if you can make it suppressable with ${\}.
>>
>
> Patch attached.
>
> ./perl -wle '"" =~ m/$\s/;'
> Possible unintended interpolation of $\ in regex at -e line 1.

Thanks, applied as #34224, except that I moved the test in t/lib/warnings/toke.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About