Rob Lambden wrote:
sub SetupPageArguments()
{
my ($DB, $nLoop, @Query, $Key, $Value);

$DB=shift;
@{$DB->{Page}->{'.parameters'}}=$DB->{ApacheReq}->param();

for($nLoop=0; $nLoop<=$#{$DB->{Page}->{'.parameters'}}; $nLoop++)
{
if(!defined($DB->{ApacheReq}->param($DB->{Page}->{'.parameters'}[$nLoop]
)))
{
$DB->{Page}->{$DB->{Page}->{'.parameters'}[$nLoop]}[0]='';
}
else
{
@{$DB->{Page}->{$DB->{Page}->{'.parameters'}[$nLoop]}}=$DB->{ApacheReq}-

param($DB->{Page}->{'.parameters'}[$nLoop]);
      }
    }
What's the purpose of that loop? Is it just to copy the data out of Apache::Request/CGI? I would do something a little more compact, like this:

my @keys = $DB->{ApacheReq}->param();
my %param_hash = map { $_, [ $DB->{ApacheReq}->param($_) ] } @keys;
$DB->{Page} = \%param_hash;
$DB->{Page}->{'.parameters'} = \@keys;

However, when I send a large block of data in with the
request I have found that portions of the middle are left out. Putting the old code back
means that the whole of the text is seen.
Have you tried debugging the individual parameters to see exactly which ones(s) are getting munged? Print them out in both versions and compare them to see where the data is being lost.

- Perrin



Reply via email to