I'm porting some older C software to an interim interface with perl as a go-between, and I'm hoping that much of what I need to do can be handled with existing modules.

my script will be called through the linux env command, which sets environment variables, then applies them to the script:

env REQUEST_METHOD=GET DATA_SOURCE=cmdline QUERY_STRING=DBNAME=mydatab +ase+SF=dbfield+SV="search_string"+HEAD=none+TAIL=none+TEMPLATE_DIR=te +mplates/path/+CONTENT_TYPE=none /home/evan/test.pl
so these are then accessible in perl through the %ENV hash. the important one here is $ENV{QUERY_STRING}, because I'd like to parse it with the CGI module, but because its delimited with plus signs instead of ampersands, CGI doesnt seem to like that. it stores it all as one name=value pair (interpreting the + delimiters as spaces):
use CGI; use Data::Dumper; my $q = new CGI( $ENV{QUERY_STRING} ); print Dumper( $q->param('DBNAME') ); # this outputs: $VAR1 = 'mydatabase SF=dbfield SV="search_string" HEAD=none TAIL=none +TEMPLATE_DIR=templates/path/ CONTENT_TYPE=none';
so, my question (for now) is, can I tell CGI to interpret this string as not URL-encoded, and to use the + as a delimiter? or is there a Better Way?

Edited by davorg: Fixed code tags to allow line to split


In reply to using CGI with different delimiter than '&' by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.