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

RE: [perl #54702] Feature: regexp modifier to disable interpolation like m''

Thread Previous | Thread Next
From:
Ed Avis
Date:
August 21, 2012 16:05
Subject:
RE: [perl #54702] Feature: regexp modifier to disable interpolation like m''
Message ID:
3473E52454418E4094496BFAAC199441023B7FB5@wcl-exch01.wcl.local
I feel that a way to avoid double-quote interpolation in regexps is sometimes needed (for progranner sanity) but I can accept that stuffing more options into the already complex regexp syntax may not be the way.  I would be happy to have a programmatic way to drive the regexp engine without special syntax:

    my $subst = new Regexp::Subst(qr/a+/, 'b');
    my $in = 'xaa';
    say $subst->($in); # prints xb

Then most of the quoting problems go away.  A mechanism for compiling regexps from strings without qr// syntax would also be welcome.  Or is there already a well-known module to do this stuff?


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

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