Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to map URL to %xx?

Reply
Thread Tools

How to map URL to %xx?

 
 
Liberal
Guest
Posts: n/a
 
      12-12-2003
I need to map things like http:// to the %xx code. Change none
digital/letter to % then the ASCII value in 16.

It should be a 1 line code.


 
Reply With Quote
 
 
 
 
Tony Curtis
Guest
Posts: n/a
 
      12-12-2003
>> On Fri, 12 Dec 2003 03:14:35 GMT,
>> "Liberal" <> said:


> I need to map things like http:// to the %xx code. Change
> none digital/letter to % then the ASCII value in 16.


Sounds like you want URI::Escape

> It should be a 1 line code.


Homework, eh?
 
Reply With Quote
 
 
 
 
Liberal
Guest
Posts: n/a
 
      12-12-2003
$url =~ s/([^\w.-])/sprintf "%%%02X", ord $1/eg;

don't understand it and don't care. it works.


 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      12-12-2003
>>>>> "L" == Liberal <> writes:

> $url =~ s/([^\w.-])/sprintf "%%%02X", ord $1/eg;
> don't understand it and don't care. it works.


and you will never understand perl thinking like that. good luck with
future homework and all those spammers and crackers who will ream your
homegrown cgi scripts.

$DIETY save us from twits like you who think they should be allowed to
code.

uri

--
Uri Guttman ------ -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      12-12-2003

"Liberal" <> wrote in message
news:z3bCb.181886$...
> $url =~ s/([^\w.-])/sprintf "%%%02X", ord $1/eg;
>
> don't understand it and don't care. it works.
>


You've joined a long tradition of sloppy programmers with that response. And
the standard reply is if you don't know what it's doing, how do you know it
works?

Matt


 
Reply With Quote
 
Matija Papec
Guest
Posts: n/a
 
      12-12-2003
On Fri, 12 Dec 2003 04:00:31 GMT, "Liberal" <> wrote:

>$url =~ s/([^\w.-])/sprintf "%%%02X", ord $1/eg;
>
>don't understand it and don't care. it works.


So, you just wanted to share your thoughts with the world?

 
Reply With Quote
 
Chris Mattern
Guest
Posts: n/a
 
      12-12-2003
Matija Papec wrote:
> On Fri, 12 Dec 2003 04:00:31 GMT, "Liberal" <> wrote:
>
>
>>$url =~ s/([^\w.-])/sprintf "%%%02X", ord $1/eg;
>>
>>don't understand it and don't care. it works.

>
>
> So, you just wanted to share your thoughts with the world?
>

Well, posting the answer to your own question if you find it elsewhere
is good netiquette; you have to give him credit for that, even if his
attitude towards understanding the code he uses is horrible.

Chris Mattern

 
Reply With Quote
 
Randal L. Schwartz
Guest
Posts: n/a
 
      12-12-2003
>>>>> "Liberal" == Liberal <> writes:

Liberal> I need to map things like http:// to the %xx code. Change none
Liberal> digital/letter to % then the ASCII value in 16.

Well, you don't need to change http://, but perhaps some of the
things that form a URI later. See the URI module for all the options.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
 
Reply With Quote
 
Matija Papec
Guest
Posts: n/a
 
      12-13-2003
X-Ftn-To: Chris Mattern

Chris Mattern <> wrote:
>> So, you just wanted to share your thoughts with the world?
>>

>Well, posting the answer to your own question if you find it elsewhere
>is good netiquette; you have to give him credit for that, even if his
>attitude towards understanding the code he uses is horrible.


Indeed, there is a good reading which covers more aspects of such attitude
http://www.sampioni.com/en/zasto_sampioni.htm


--
Matija
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
std::map::find() throws exception when map is empty? Matthias Hildebrand C++ 5 03-20-2012 06:09 AM
I can map all files (.*) to asp.net worker.How do I map NO FILE to asp.net worker? alex ASP .Net 1 02-04-2005 03:18 AM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57