perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Melchers <melch...@nureg.de>
Subject Setting %fdat by script?
Date Wed, 18 Apr 2001 08:48:15 GMT
Hi,

I am trying to mix Mason and Embperl and have a problem with inserting
data into %fdat by the script.
I am not sure, if my problem (see below) is triggered by Mason or
Embperl.


My setup: Apache 1.2.13, mod_perl 1.24 not DSO, Embperl 1.3.1, Mason
1.0.


index.html is parsed by mason; mason puts a navigation around the
index.html:
-------------- index.html -----
<%init>
use HTML::Embperl;

my $out="";
HTML::Embperl::Execute({inputfile=>"/some/dir/formular.epl",fdat=>\%ARGS,output=>\$out});
</%init>
<% $out %>
-------------- end index.html ---------

So mason calls Embperl, executes formular.epl and returns the output.

In formular.epl I read a file and insert these data into %fdat for
further form processing.

So I do (pseudo code):

foreach $key (keys %filehash) {
	$fdat{$key}=$filehash{$key}
}

Then I have a form to proceed to the next step and pass %fdat via
[$hidden$]

The problem: my inserted data is not passed to the next page.

I tried to insert the following code inside the foreach loop:

$f=0;
foreach $i (0..$#ffld) {
	if($ffld[$i] eq "${bereich}_${key}") {
		$f=1;
	}
} 
if ($f == 0) {
	push @ffld, "${bereich}_${key}";
}

This helped, but sometimes the data in %fdat gets doubled, so all fields
are stored twice and Data::Dumper show only ARRAY(0x...), no more
values.


Long story, short question: What is the right way to insert data into
%fdat?


Tschuess,

Dirk Melchers.

-------------------------------------------------------------------------
Dirk Melchers             NUREG Neue Medien       Fon   +49 911
32002-256
melchers@nureg.de        Dorfäckerstrasse 31      Fax   +49 911
32002-299
http://www.nureg.de       D-90427 NĂĽrnberg        Mobil +49 172 935 46
70
-------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message