I'm having problems with Embperl 1.2.0. It core dumps
when calling Execute() with $fdat and $ffld params on
input files with <OPTION> tags that contain value params
, eg. <OPTION VALUE="val">. Embperl 1.2b4 has no problem
with it though. 

A sample cgi script:

#!/usr/local/bin/perl

use strict;
use HTML::Embperl ();
use CGI ();

my $cgi         = CGI->new();
my $fdat        = {
                        'param1'        => 'val2',
                };

print $cgi->header;
HTML::Embperl::Execute(
        {
                inputfile       => 't1.html',
                ffld            => [ keys %$fdat ],
                fdat            => $fdat,
                debug           => HTML::Embperl::dbgAllCmds |
                                   HTML::Embperl::dbgSource |
                                   HTML::Embperl::dbgFlushLog,
        }
);

t1.html:

<HTML>
<HEAD>
<TITLE>Test Doc</TITLE>
</HEAD>
<BODY>

<FORM>
<SELECT NAME="param1">
        <OPTION VALUE="val1"> Value 1
        <OPTION VALUE="val2"> Value 2
        <OPTION VALUE="val3"> Value 3
</SELECT>
</FORM>

</BODY>

The problem disappears when I do one of the following:

        - Revmove the VALUE="valN" paramaters in the <OPTION> tags
        - Set optDisableInputScan
        - Don't pass a $fdat and $ffld

all of which defeat the auto-fillin feature. If I remove
the VALUE params from the <OPTION> tags and pass in:

        $fdat = { param1 => 'Value 2' }

I get no auto-fillout of the <SELECT> elements.


With the above debug options, here's the DEBUG_LOG output:

[11544]REQ:  No Safe Eval  All Opcode allowed   mode = Offline (4)
[11544]REQ:  Package = HTML::Embperl::DOC::_1
[11544]Open STDOUT for output...
[11544]Reading t1.html as input using PerlIO ...
[11544]SRC: Line 1: <HTML>
[11544]CMD-:  Cmd = 'html'
[11544]SRC: Line 1: <HEAD>
[11544]CMD-:  Cmd = 'head'
[11544]SRC: Line 2: <TITLE>Test Doc</TITLE>
[11544]CMD-:  Cmd = 'title'
[11544]SRC: Line 3: </TITLE>
[11544]CMD-:  Cmd = '/title'
[11544]SRC: Line 3: </HEAD>
[11544]CMD-:  Cmd = '/head'
[11544]SRC: Line 4: <BODY>
[11544]CMD+:  Cmd = 'body'
[11544]SRC: Line 5: <FORM>
[11544]CMD+:  Cmd = 'form'
[11544]SRC: Line 7: <SELECT NAME="param1">
[11544]CMD+:  Cmd = 'select'
[11544]SRC: Line 8: <OPTION VALUE="val1"> Value 1
[11544]CMD+:  Cmd = 'option'

So it looks like it makes it to the first <OPTION> tag
and croaks.

Are there any patches to 1.2.0? Is this a know bug?
Should I revert to 1.2b4?

Thanks,

Dave

Reply via email to