Hi Monks,

I have a CGI program which gets a URL looks like this:

http://example.mycgi.com:9999/service?func=search&institute=DEMO&calling_app=ABC&url=http://return.link.com:8997/F?local_base=admin&func=save&base=staff

All what comes after the "&url=" is a backlink URL which I need to find.
Now, I am trying to parse the part from the "&url=" to the end but cannot find a way of doing it.
When using the "query_string" function, I get the following string:

func=search;func=save;institute=DEMO;calling_app=ABC;url=http%3A%2F%2Freturn.link.com%3A8997%2FF%3Flocal_base%3Dadmin;base=staff

Notice that the "func=save" is moved from its place to be after the "func=search", and now I cannot find it when I create the back URL.

Is there a way to simply get the full URL as is and parse it by myself?

Thanks

In reply to How to parse URL in CGI.pm by asafp

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.