RE: Cannot retrieve empty keys from request using Apache2::Request.param

Josh Narins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <F61EA32D7A6A79478142BA12E77AEE83266EE7227E@MS3.nyc.seniorbridgeinternal.com>
> 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
[email protected]

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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.