perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Narins <jnar...@seniorbridge.com>
Subject RE: Cannot retrieve empty keys from request using Apache2::Request.param
Date Tue, 03 Jan 2012 19:46:36 GMT
> 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 HTML entities and other legal uses of & in the text
returned by ->param();


Josh Narins
Director of Application Development
SeniorBridge

845 Third Ave
7th Floor
New York, NY 10022
Tel: (212) 994-6194
Mobile: (917) 488-6248
Fax: (212) 994-4260
jnarins@seniorbridge.com

SeniorBridge
Managing Complex Chronic Care
http://www.seniorbridge.com



SeniorBridge Statement of Confidentiality: The contents of this email message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
Any dissemination, distribution or copying of this email by an unintended or mistaken recipient
is strictly prohibited. In said event, kindly reply to the sender and destroy all entries
of this message and any attachments from your system. Thank you.

Mime
View raw message