⭐ 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:
In the more general case, you can use sprintf to interpolate functions into strings:my $sth = $dbh->prepare("select * from foo where bar = ?"); $sth->execute($userinput);
my $sql = sprintf "select * from foo where bar = %s", $dbh->quote($use +rinput);
|
---|
In Section
Seekers of Perl Wisdom