Hi all,

  I've noticed a problem with the way Embperl parses certain strings
that contain "-]" or "+]" when passed to Execute using the input hash
element. I haven't tested with other tag types but I'm assuming they
work (or don't in this case) similarly.

It seems that Embperl treats a closing block tag as a real one when it
is contained within an explicit string reference to the Execute
function. Perhaps it would be easier to see from the examples
below. The only things I've changed are the tag types surrounding the
real block and/or the tags within the Execute'd string ref.

This is annoying but not impossible to get around, once I'd figured
out what was causing the error :) Since it is not what you'd expect to
be happening (and isn't documented ;) I'd propose this as a bug. Or am
I missing something intrinsic here ?

Heres a proof of concept along the lines of the examples in the
eg/x/Execute.pl file in the source. This fails using 1.3b[56] and
EmbperlObject.

A base file containing:

<html><head><title>Blah</title></head>
<body>
[- Execute('*'); -]
</body>
</html>

A file containing the following does not fail. Note the different
block delimiters both within the string and surrounding the Execute
statement.

[+
 @q = ( );
 Execute ({ input     => \'[- $param[0] = [1,2,3]; -] <p>Done some
substitutions on param0 ... </p>',
            inputfile => 'Return array by reference',
            param     => \@q }
                 );
 @{ q[0] }->[2]; # prints "3"
+]

but either of the next two blocks *do* fail:

[-
 @q = ( );
 Execute ({ input     => \'[- $param[0] = [1,2,3]; -] <p>Done some
substitutions on param0 ... </p>',
            inputfile => 'Return array by reference',
            param     => \@q }
                 );
 @{ q[0] }->[2]; # prints "3"
-]

[+
 @q = ( );
 Execute ({ input     => \'[+ $param[0] = [1,2,3]; "";+] <p>Done some
substitutions on param0 ... </p>',
            inputfile => 'Return array by reference',
            param     => \@q }
                 );
 @{ q[0] }->[2]; # prints "3"
+]

--
  Andrew O'Brien
  [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to