Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Quoting URIs

by ambs (Pilgrim)
on Apr 11, 2005 at 06:36 UTC ( [id://446553]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

ambs has asked for the wisdom of the Perl Monks concerning the following question:

I need to pass as parameter for a script a complete URL. This URL can itself be an URL for a script. So, I need to quote special characters like '&' and '?'.

Is there any module to quote special characters on URIs? Like the standard s/ /%20/ one?

Thanks in advance.

Alberto Simões

Replies are listed 'Best First'.
Re: Quoting URIs
by ambs (Pilgrim) on Apr 11, 2005 at 06:37 UTC
Re: Quoting URIs
by Jenda (Abbot) on Apr 11, 2005 at 07:56 UTC

    There's also CGI::Enurl

    Jenda
    We'd like to help you learn to help yourself
    Look around you, all you see are sympathetic eyes
    Stroll around the grounds until you feel at home
       -- P. Simon in Mrs. Robinson

Re: Quoting URIs
by ambrus (Abbot) on Apr 11, 2005 at 16:00 UTC

    Yes, it's CGI.

    perl -we 'use CGI; print CGI::escape("hello, world\n"), $/'
    ==>
    hello%2C%20world%0A

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://446553]
Approved by muntfish
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.