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 "
:   #     sub add ($left, $right) {
:   #         return $left + $right;
:   #     }
:   # "
: 
: Where you could whatever you wanted instead of «».

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.

Larry

Reply via email to