EndPointCorp / end-point-blog

End Point Dev blog
https://www.endpointdev.com/blog/
17 stars 65 forks source link

Comments for DBD::Pg escaping placeholders with backslashes #1068

Open phinjensen opened 7 years ago

phinjensen commented 7 years ago

Comments for https://www.endpointdev.com/blog/2015/01/dbdpg-escaping-placeholders-with/ By Greg Sabino Mullane

To enter a comment:

  1. Log in to GitHub
  2. Leave a comment on this issue.
phinjensen commented 7 years ago
original author: richardh
date: 2015-10-01T18:35:20-04:00

Or perhaps better than double-quotes is to use Perl's quoting operators:

my $sql = q{SELECT ... WHERE x \? y AND foo = ?};

phinjensen commented 7 years ago
original author: Greg Sabino Mullane
date: 2015-10-04T20:19:11-04:00

Sure, that's a valid alternative to single quotes, although I like double because you won't get surprised when a variable you add silently fails to get interpolated. :)