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

Re: Calling a method within a double-quoted string?

by plaid (Chaplain)
on Jun 10, 2000 at 04:11 UTC ( #17473=note: print w/replies, xml ) Need Help??


in reply to Calling a method within a double-quoted string?

You should use place holders in this case, as they automatically take care of quoting:

my $sth = $dbh->prepare("select * from foo where bar = ?"); $sth->execute($userinput);
In the more general case, you can use sprintf to interpolate functions into strings:
my $sql = sprintf "select * from foo where bar = %s", $dbh->quote($use +rinput);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://17473]
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 2022-01-27 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (71 votes). Check out past polls.

    Notices?