Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-11-29 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?