develooper Front page | perl.perl5.porters | Postings from February 2012

Re: [perl #109798] '/e' regexp modifier is not recognized by re pragma

Thread Previous | Thread Next
From:
demerphq
Date:
February 5, 2012 09:59
Subject:
Re: [perl #109798] '/e' regexp modifier is not recognized by re pragma
Message ID:
CANgJU+XdHea6irju072PS9UWcKPja4kqusRs8u0pxoSF0b2ZDw@mail.gmail.com
On 5 February 2012 18:44, Tom Christiansen <tchrist@perl.com> wrote:
>> Why? You think throwing a fatal is preferred? They do nothing, they
>> have no affect.
>
> How can this not be a bug?

My personal feeling on this is that it matches the general tradition
of perl not croaking when no harm is done by not croaking. Since the
operators are meaningless why break the code over a typo?

I did not implement the feature, but considering the warning was
deliberately added I assume it is a feature.

>    $ perl -E 'no warnings; use re "/g"; say "gosh that was ok, then, eh?"'
>    Unknown regular expression flag "g" at -e line 1
>    gosh that was ok, then, eh?
>
>    $ perl -E 'use warnings FATAL => "all"; use re "/g"; say "gosh that was ok, then, eh?"'
>    Unknown regular expression flag "g" at -e line 1
>    gosh that was ok, then, eh?
>
>    $ perl -E 'use warnings FATAL => "all"; use re "/WTF"; say "gosh that was ok, then, eh?"'
>    Unknown regular expression flag "W" at -e line 1
>    gosh that was ok, then, eh?
>
> I can't disable them.
> I can't trap them.
> They're stupid noise.

So then fix your code.

> Yes, I want a fatal.

Well, I personally could see it either way, and am inclined slightly
towards the no-die policy.

> I certainly want to be *able* to have a fatal.
>
> I think they should be a fatal.
>
> They most definitely shouldn't be noise.

Warnings are noise?

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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