Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: unpacking - html re-encoding?

by alfie (Pilgrim)
on Jul 18, 2001 at 11:09 UTC ( #97564=note: print w/replies, xml ) Need Help??

in reply to unpacking - html re-encoding?

You might find the quotemeta function quite useful - it's exactly for this purposes.

Update: Alright - I shot before finish reading :/
About converting special characters: The CGI module gives you the function you need to do that.
About the date-check: m/\d{4}-\d{2}-\d{2}/ should do the trick - read perlre for why.

And finally, about mailing you: Sorry, I don't do that stuff. If one is searching for help in a special place s/he should also check back there for the answers - that's the way a community works, by sharing the thoughts. Especially on topics like this. It is easy that I might have missed the one or the other thing (like simply stated by this update ;) - others might add to it. That's not possible if I would have mailed you.... Think of it.
use signature; signature(" So long\nAlfie");

Replies are listed 'Best First'.
Re: Re: unpacking - html re-encoding?
by iakobski (Pilgrim) on Jul 18, 2001 at 11:26 UTC
    quotemeta is close but not a perfect fit. It will escape (with a backslash) any non-alphanumeric which includes ALL punctuation and even spaces.

    In most dialects of SQL, quotes are escaped by doubling them:

    he said, "I'LL be back"
    Would need to become:
    'he said, "I''LL be back"'
    Using the example given by the questioner. There's no need to escape other punctuation or spaces. And I said most, because the quoting given by DBI::quote() will match that required by the database transparently.

    Update OK, alfie so you updated your reply while I was writing that. And ++ for the bit about asking for an e-mail.

    -- iakobski

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-01-27 02:54 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (70 votes). Check out past polls.