in reply to qr// with /e?

I'd be more for a Regexp->new( ... ) which stringifies its argument and then does the qr//. None of the other of the quotelike operators (q// et al) have suffixes so it doesn't seem regular (although it would be orhtogonal to the usage with s///).

Update: Ooh, good point davido. Of course one might say that the trailing flags are really just syntactic sugar for embedded flags a la qr/(?imosx:...)/.

Replies are listed 'Best First'.
Re: Re: qr// with /e?
by davido (Cardinal) on Apr 24, 2004 at 23:47 UTC
    "None of the other quotelike operators (q// et al) have suffixes so it doesn't seem regular..."

    But qr// already does have other suffixes. See perlop under "Regex Quote Like Operators". qr// allows for qr//imosx. So the reason for not adding /e can't be because other quote-like operators don't have modifiers. The main reason is that it doesn't make sense since /e only causes an eval{} block to wrap around the right-hand portion of a s/// operator, and qr// doesn't construct that right-hand portion in the first place.

    tie probably had it; don't call it /e. Call it /E or something else to avoid confusion with the longstanding function of the /e modifier.


    Dave

Re: Re: qr// with /e?
by tkil (Monk) on Apr 24, 2004 at 23:23 UTC
    I'd be more for a Regexp->new( ... ) which stringifies its argument and then does the qr//.

    Hm. qr->( EXPR ) maybe?

    None of the other of the quotelike operators (q// et al) have suffixes so it doesn't seem regular (although it would be orhtogonal to the usage with s///)

    Heh. I wonder if this would fly if I suggested the name qre//? :)