Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: Test if string is already quote()'d?

by demerphq (Chancellor)
on Jun 15, 2003 at 14:54 UTC ( [id://266035]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Test if string is already quote()'d?
in thread Test if string is already quote()'d?

But then again, it won't solve the problem of checking for escaped quotes within the string.

To me this is the wrong time/place to worry about this. You deal with issues like that when you read your data in. My understanding is that the OP wanted to design an interface that could take quoted variables and do the right thing, or take unquoted variables and do the right thing. As long as the interface defines clearly what constitues a quoted variable, and what the rules it uses to recognize one, then it is the callers responsibility to handle the data appropriately.

Consider that perhaps on occasion the fact that the quote handling isn't perfect may be a useful workaround for a tight situation.

However the fact that this behaviour is open to abuse might make me add a safety mechanism to prevent it if I choose, and would certainly result in a note in the documentation stating that it is no more secure than the data it is fed.


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

Replies are listed 'Best First'.
Re: Re: Re: Re: Test if string is already quote()'d?
by Seumas (Curate) on Jun 17, 2003 at 23:15 UTC
    To me this is the wrong time/place to worry about this. You deal with issues like that when you read your data in

    That's what I was originally doing, too. But because I still needed to use the data and manipulated it and return it to the user, it meant I needed to keep two copies of the data. One that was from the form/input and one that was the quoted version (which would be just as updated).

    What I was aiming for was flexibility more than anything else. But I guess that the abstraction layer I've written for the DB stuff now should accomplish the flexibility since it handles matching the names, values and placeholders automatically and always runs prepare() on them itself.

Log In?
Username:
Password:

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

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

    No recent polls found