Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Better Algorithm to Encode This?

by extremely (Priest)
on Jun 13, 2001 at 05:54 UTC ( #87979=note: print w/ replies, xml ) Need Help??


in reply to Re: Better Algorithm to Encode This?
in thread Better Algorithm to Encode This?

You'll need to encode the "." period for that to work correctly!!! (I couldn't help but golf it down a little, sorry.)

## No Period in the char class! $STRING =~ s/([^a-zA-Z0-9_-])/lc sprintf(".%02x", ord($1))/eg; ## my encode $S =~ s/([^\w-])/sprintf".%02x",ord$1/eg; ## my decode $S =~ s/\.(..)/chr hex $1/eg;

--
$you = new YOU;
honk() if $you->love(perl)


Comment on Re: Re: Better Algorithm to Encode This?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2015-03-28 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (621 votes), past polls