Larry Wall wrote : > > Well, if anything, we're going the other direction, and enriching what > you can do with a backslash in single quotes slightly. But it ought > to be pretty easy to define your own hyperquotes. We might also have > options on quotes like we do on regexen. Then we could tell it what > to interpolate and what not to: > > q:bsahfmc/\t $foo @array %hash &func() $obj.method() { closure }/ > > 'Course, that's pretty klunky.
And that doesn't seem very flexible. If you're going to specify your quoting rules for your own q// operators, I think that this should be specified as hints to the very perl parser. A simple example : in C<myq/@foo[42]/>, you could choose to interpolate only the array @foo, or the array element @foo[42]. > So maybe we have something like an > immediate subroutine definition: > > my sub qa is quote("bsahfmc") {...} > qa/\t $foo @array %hash &func() $obj.method() { closure }/ > > Then you could say something like: > > my sub q is quote("") {...} > 'You think I' _ q{'} _ 'm knit-picking!' > > to get the behavior you want. That sounds a bit like my Sub::Quotelike module.