Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 wandering the Monastery: (4)
As of 2015-07-05 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls