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

Re: CGI fails to urlencode & chars in outbound url's

by cjf (Parson)
on Jun 12, 2002 at 10:42 UTC ( #173756=note: print w/ replies, xml ) Need Help??


in reply to CGI fails to urlencode & chars in outbound url's

Take a look at the uri_escape() method of URI::Escape.


Comment on Re: CGI fails to urlencode & chars in outbound url's
Re: Re: CGI fails to urlencode & chars in outbound url's
by BrowserUk (Pope) on Jun 12, 2002 at 11:07 UTC

    Thanks. Exactly what I needed.

    Without going into long explanations of Perl internals, is there a reason this has been implemented as:

    use URI::Escape; $encoded = uri_escape($unsafe_uri);

    instead of as (what seems to me would more intuative (and easier to find))

    use URL qw( urlencode ); $encoded = urlencode( $unsafe_uri );

    Or is this a simple case of "Thats the way the author chose to do it"?

      Or is this a simple case of "Thats the way the author chose to do it"?

      Pretty much. The author of a module can name it whatever they want to. Whether or not CPAN allows them to upload it under that name is a different issue (you can probably find the answer in The CPAN Faq).

      As for why the URI module was named URI instead of URL, there is a slight difference between the two. More information on this is available here.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2014-09-21 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls