From: Matt S Trout Date: Fri, 17 May 2019 02:21:25 +0000 (+0000) Subject: smarter sqlacexpr X-Git-Tag: v2.000000~3^2~168 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86654e4506ea8f8ab7eb3f5b1c37bdc617091299;p=dbsrgits%2FSQL-Abstract.git smarter sqlacexpr --- diff --git a/maint/sqlacexpr b/maint/sqlacexpr index 63b41f6..e9cd322 100755 --- a/maint/sqlacexpr +++ b/maint/sqlacexpr @@ -1,12 +1,13 @@ +use strictures 2; use SQL::Abstract::ExtraClauses; -use Devel::Dwarn; +use Devel::DDCWarn; warn $ARGV[1]; -my @args = eval '('.$ARGV[1].')'; +my $sqlac = SQL::Abstract::ExtraClauses->new(unknown_unop_always_func => 1); -die $@ if $@; +my @args = ($ARGV[1] =~ /^\.\// ? do $ARGV[1] : eval '+('.$ARGV[1].')'); -my $sqlac = SQL::Abstract::ExtraClauses->new(unknown_unop_always_func => 1); +die $@ if $@; Dwarn([ $sqlac->${\$ARGV[0]}(@args) ]);