Skip to content

Instantly share code, notes, and snippets.

@Meettya
Created December 17, 2011 10:15
Show Gist options
  • Save Meettya/1489867 to your computer and use it in GitHub Desktop.
Save Meettya/1489867 to your computer and use it in GitHub Desktop.
SQL::Interp example
#!/usr/bin/env perl
use v5.14;
use warnings;
# develop mode
use Smart::Comments;
use Data::Printer;
use SQL::Interp ':all';
my %item = (
user => 'Bar Bazz',
password => '12345',
login => 'foo',
);
my ($sql, @bind) = sql_interp 'UPDATE table SET', \%item, 'WHERE y <> ', \26, 'AND z IN', [3,4,5];
p($sql);
p(@bind);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment