Skip to content

Instantly share code, notes, and snippets.

@psandin
psandin / sql_pp.pl
Last active August 29, 2015 14:14
Pretty print the output from DBIC's resultset->as_query
sub sql_pp {
my $ref = shift;
use SQL::Beautify;
use Scalar::Util qw(looks_like_number blessed);
my ($sql, @param);
if(blessed($ref) && $ref->can('as_query')){
($sql, @param) = @{${$ref->as_query}};
### Keybase proof
I hereby claim:
* I am psandin on github.
* I am psandin (https://keybase.io/psandin) on keybase.
* I have a public key whose fingerprint is 021A D8E4 33FC 8DEE D39F 4B83 6094 A8EF DA37 AD94
To claim this, I am signing this object: