if ($query eq '-') {
print STDERR "Interactive mode engaged! Waiting for a query on <STDIN>...\n"
if -t STDIN; ## no critic (InputOutput::ProhibitInteractiveTest)
if ($query eq '-') {
print STDERR "Interactive mode engaged! Waiting for a query on <STDIN>...\n"
if -t STDIN; ## no critic (InputOutput::ProhibitInteractiveTest)
_print_data($data, $format);
exit($unpack && $err ? 1 : 0);
_print_data($data, $format);
exit($unpack && $err ? 1 : 0);
if (ref($item) eq 'ARRAY') {
my $first = @$item && $item->[0];
return join(',', @$item) if !ref($first);
if (ref($item) eq 'ARRAY') {
my $first = @$item && $item->[0];
return join(',', @$item) if !ref($first);
my ($data, $format) = @_;
$format = lc($format || 'json:pretty');
if ($format eq 'json' || $format eq 'json:pretty') {
my ($data, $format) = @_;
$format = lc($format || 'json:pretty');
if ($format eq 'json' || $format eq 'json:pretty') {