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

Re: Empty regex

Thread Previous | Thread Next
From:
Bram
Date:
June 19, 2008 00:06
Subject:
Re: Empty regex
Message ID:
20080619090432.celktvvhcgswoww8@horde.wizbit.be
> Any code that contains the innocent-looking
>
>         if (/\Q$string\E/) {
>           ...
>         }
>
> is potentially booby-trapped. Such code is common.
>
> -- >8 --
>
> Is there anyway to make /$string/ warn if $string is empty? Maybe even in
> future releases of perl?
>

Relevant to this discussion:

http://www.nntp.perl.org/group/perl.perl5.porters/2008/05/msg136887.html
http://www.nntp.perl.org/group/perl.perl5.porters/2008/05/msg136687.html

Which suggest that m// might be removed in a future version. And be  
replaced with m/(*LAST_PAT)/  (or something like that - look at the  
thread for the details).


Kind regards,

Bram




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