I am using embperl in a non-standard way to take care of old perl code which
has html embedded in it via print statements.
Here is a summarized top-to-bottom (1->2->3) overview of the architecture:
1. legacy.phtml
HTML::Embperl::Execute({ inputfile => 'legacy_pm.epl',
param => ['legacy.pm'], fdat => \%IN, options => 256 });
2. legacy_pm.epl
--------------
[.-
$app = shift @param;
eval "use perllib::${app}"; print $@ if $@;
use IO::Scalar;
$s = undef;
tie *OUT, 'IO::Scalar', \$s; # override OUT handle so that print statements
will go to $s
$SaveSTDOUT = select; # save current handle
select OUT; # set default handle so that "print" without a handle will
default to this
eval "${app}::main()"; print $@ if $@;
select $SaveSTDOUT; # restore original handle
$escmode = 0; #don't escape html tags (in $s)
-]
[+ $s +]
--------------
3. legacy.pm
- %IN = ();
if ($r->method eq "POST") {
%IN = $r->content;
} else {
%IN = $r->args;
}
-bunch of perl code with print statements which go to $s
__END__
All this works perfectly via GET.
When using POST, the request hangs at the $r->content point.
Why?
Any help or clues are appreciated.
Thank you.
ilia.
has html embedded in it via print statements.
Here is a summarized top-to-bottom (1->2->3) overview of the architecture:
1. legacy.phtml
HTML::Embperl::Execute({ inputfile => 'legacy_pm.epl',
param => ['legacy.pm'], fdat => \%IN, options => 256 });
2. legacy_pm.epl
--------------
[.-
$app = shift @param;
eval "use perllib::${app}"; print $@ if $@;
use IO::Scalar;
$s = undef;
tie *OUT, 'IO::Scalar', \$s; # override OUT handle so that print statements
will go to $s
$SaveSTDOUT = select; # save current handle
select OUT; # set default handle so that "print" without a handle will
default to this
eval "${app}::main()"; print $@ if $@;
select $SaveSTDOUT; # restore original handle
$escmode = 0; #don't escape html tags (in $s)
-]
[+ $s +]
--------------
3. legacy.pm
- %IN = ();
if ($r->method eq "POST") {
%IN = $r->content;
} else {
%IN = $r->args;
}
-bunch of perl code with print statements which go to $s
__END__
All this works perfectly via GET.
When using POST, the request hangs at the $r->content point.
Why?
Any help or clues are appreciated.
Thank you.
ilia.