Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by cjf (Parson)
on Jun 12, 2002 at 10:42 UTC ( [id://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

Replies are listed 'Best First'.
Re: Re: CGI fails to urlencode & chars in outbound url's
by BrowserUk (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://173756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 20:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found