Thank you André for the clear explanation!
Josh Narins wrote:
How about a little perl string manipulation?
#my $a = 'key1=value1&key2=&key3=value3';
my $a = 'key1=value1&key2&key3=value3';
my $b = join "&", map { my $c = ($_ =~ m/(\S+)=(\S*)?/o) ? $_ : "$_=";
$c; } split "&", $a;
print "a= $a\nb= $b\n";
This is not a good idea becaus
> How about a little perl string manipulation?
>
> #my $a = 'key1=value1&key2=&key3=value3';
> my $a = 'key1=value1&key2&key3=value3';
>
> my $b = join "&", map { my $c = ($_ =~ m/(\S+)=(\S*)?/o) ? $_ : "$_=";
> $c; } split "&", $a;
>
> print "a= $a\nb= $b\n";
This is not a good idea because of HT
print "a= $a\nb= $b\n";
-James
-Original Message-
From: Randolf Richardson [mailto:rand...@modperl.pl]
Sent: Tuesday, January 03, 2012 1:13 PM
To: mod_perl list
Subject: Re: Cannot retrieve empty keys from request using
Apache2::Request.param
> Tommaso Torti wrote:
> &
> Tommaso Torti wrote:
> > Hi all,
> >
> > i'm using mod_perl in order to retrieve all keys from a POST request with:
> >
> > my $request = Apache2::Request->new($r);
> > my $data = $request->param();
> >
> > When i receive something like
> > key1=value1&key2=&key3=value3
> > $data contains all
Hi Andrè
the input i'm receiving is not directly invoked from an html form, but
it could be built from java code or php or other sources i don't even
know.
So i can't use javascript to fix the problem ..
Thank you,
Tommaso Torti wrote:
Hi all,
i'm using mod_perl in order to retrieve all keys from a POST request with:
my $request = Apache2::Request->new($r);
my $data = $request->param();
When i receive something like
key1=value1&key2=&key3=value3
$data contains all 3 keys
but with
key1=value1&key2&key3=v
Hi all,
i'm using mod_perl in order to retrieve all keys from a POST request with:
my $request = Apache2::Request->new($r);
my $data = $request->param();
When i receive something like
key1=value1&key2=&key3=value3
$data contains all 3 keys
but with
key1=value1&key2&key3=value3
$data contains on