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

Re^3: Need help escaping literal string

by roboticus (Canon)
on Nov 15, 2012 at 02:34 UTC ( #1003919=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Need help escaping literal string
in thread Need help escaping literal string

mrras25:

That's why davido mentioned placeholders. It's something like:

# Prepare a statement... my $sth = $dbh->prepare("insert into dbtable (vol) values (?)"); my $funky_string = "/vol/enycmmcfl01b_ssd2_home_1b_a/CBirbigl$'s"; $sth->execute($funky_string);

This way, you don't have to worry about the odd characters inside your statement. Building your own statements like you were trying to do just leads to the difficulties you're experiencing. That's why placeholders were invented.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^3: Need help escaping literal string
Download Code
Re^4: Need help escaping literal string
by mrras25 (Acolyte) on Nov 15, 2012 at 04:07 UTC

    OUTSTANDING folks thank you for getting back to me I will give that a whirl and see how that flows...

    Again thanks all

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-09-19 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (149 votes), past polls