Michael G Schwern writes:
> I have misgivings. I like single-quote context *because* you don't
> have to worry about anything magical (except ' and \).
Genericise it.
Alter the overloaded string constant behaviour of perl5 so that
when you say:
use MagicInterpolativeStrings;
$foo = '$bar <<$baz>> $quux';
The MagicInterpolativeStrings module has overridden q() for the
scope in which it's 'use'd, and the override subroutine is called
with:
'$bar <<$baz>> $quux'
and can return
'\$bar <<$baz>> \$quux'
which is then interpreted as a qq() string and used as the value
assigned to $foo.
IMHO the overloaded strings thing in 5.6 could be tweaked to be
more useful.
Nat