Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Quoting URIs

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

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 10:37 UTC
Re: Quoting URIs
by Jenda (Abbot) on Apr 11, 2005 at 11: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 20: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
Node Status?
node history
Node Type: perlquestion [id://446553]
Approved by muntfish
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-10-29 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (269 votes). Check out past polls.

    Notices?