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

Quoting URIs

by ambs (Pilgrim)
on Apr 11, 2005 at 10:36 UTC ( [id://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

    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"), $/'

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://446553]
Approved by muntfish
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-14 00:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found