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

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

by mobiGeek (Beadle)
on Jun 15, 2003 at 20:56 UTC ( [id://266074]=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?

If this is the case, then I would suggest enforcing a coding standard along the lines of never quote a string until just before applying to the database.

The question is a bit vague. Where are these strings coming from (database? user? other code?)? Maybe the O.P. should ask themself: what is the contract of the code that I am writing?.

It sounds like the current contract is something like: put stuff in the database that may or may not be ready to go in the database. Since there is no way to tell if something is ready or not, the contract cannot be fulfilled.

...And you can't tell if something is prepared or not. If I hand you the string 'hello', do I want you to insert 'hello' or do I want you to insert '''hello''' ?

Replies are listed 'Best First'.
Re: Re: Re: Re: Test if string is already quote()'d?
by demerphq (Chancellor) on Jun 16, 2003 at 09:27 UTC

    It sounds like the current contract is something like: put stuff in the database that may or may not be ready to go in the database. Since there is no way to tell if something is ready or not, the contract cannot be fulfilled.

    I could just as easily interpret the OP's contract as being "put stuff in a DB, quoting the things that on face value arent already quoted and ignoring things that on face value are quoted. Ensuring that something that looks quoted actually is the callers problem."


    ---
    demerphq

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found