Larry Wall writes:
> Or maybe we just stick with what we already allow:
>
> my $name = 'add';
> my $code = q[
> sub \qq[$name] ($left, $right) {
> return $left + $right;
>}
> ];
>
> After all, that's why we put \q interpolation into '' in the first place.
Ahh
On Wed, 1 Dec 2004 08:56:49 -0800, Larry Wall <[EMAIL PROTECTED]> wrote:
> Or maybe we just stick with what we already allow:
>
> my $name = 'add';
> my $code = q[
> sub \qq[$name] ($left, $right) {
> return $left + $right;
> }
> ];
>
> After all, that's w
On Wed, Dec 01, 2004 at 11:41:37AM -0500, Matt Diephouse wrote:
: So... maybe we can pass a parameter saying what we want to use to interpolate?
:
: my $name = 'add';
: my $code = q:c<«>[
: sub «$name» ($left, $right) {
: return $left + $right;
:}
: ];
: # prints "
On Wed, 1 Dec 2004 00:22:25 +, Jonathan Paton <[EMAIL PROTECTED]> wrote:
> Jim,
>
> > qq:i {} is just like qq{} except that when it interpolates variables,
> > those which are undefined are preserved literally.
>
> Interesting idea except for the flaw.
I think
Jim,
> qq:i {} is just like qq{} except that when it interpolates variables,
> those which are undefined are preserved literally.
I think surprise might be a problem. E.g.
my $index = 0;
eval qq:i {
my @array = A .. Z;
sub example {
for my $index (0 .. $
John Macdonald wrote:
The problem with "interpolate if you can or leave it alone for
later" is that when later comes around you're in a quandry.
Is the string "$var" that is in the final result there because
it was "$var" in the original and couldn't be interpolated,
or was it a $foo that had its v
Jim Cromie writes:
> since the qq:X family has recently come up, Id like to suggest another.
>
> qq:i {} is just like qq{} except that when it interpolates variables,
> those which are undefined are preserved literally.
So then when doing maintenance on some code I can break it by
On Tue, Nov 30, 2004 at 05:54:45PM -0700, Luke Palmer wrote:
> Jim Cromie writes:
> >
> > since the qq:X family has recently come up, Id like to suggest another.
> >
> > qq:i {} is just like qq{} except that when it interpolates variables,
> > those which are
Jim Cromie writes:
>
> since the qq:X family has recently come up, Id like to suggest another.
>
> qq:i {} is just like qq{} except that when it interpolates variables,
> those which are undefined are preserved literally.
Eeeew. Probably going to shoot this down. But let
Jim Cromie skribis 2004-11-30 16:53 (-0700):
>my @args = @{$template{args}};
>my $body = $template{body};
>eval sub qq:i{
> my ($self, @args) = @_;
> $body;
>}
Please explain what you want it to do with @args there.
Juerd
since the qq:X family has recently come up, Id like to suggest another.
qq:i {} is just like qq{} except that when it interpolates variables,
those which are undefined are preserved literally.
its purpose would be to support the construction of strings for
subsequent eval'g, particularly
11 matches
Mail list logo