eval $code;
die "eval returned '$@'" if $@;
wantarray ? @out : \@out;
}
sub TO_JSON {
my $self = shift;
return $self->dump(
map { $_->name } @{ $self->[f_query]->pr
$a,$b) = ($_[0]->cents, $_[1] );
new ($_[2] ? $b / $a : $a / $b);
},
'fallback' => 1;
*TO_JSON = \&dollars;
sub cents {
return '' unless defined($_[0][0]);
return $_[0][0]
};
su
# $_[0][1]->set($_[0],@_);
# }
sub next { croak "Can not call next on a record" }
sub TO_JSON { die "This part doesn't work yet" } #HERE - this needs work
#sub DESTROY { print STDERR "RECORD
=> sub { $_[1] },
'-' => sub { return $_[2] ? $_[1] : 0 - $_[1] },
'*' => sub { 0 },
'/' => sub { 0 },
'fallback' => 1
;
sub TO_JSON { undef }
our $AUTOLOAD;
sub AUTOLOAD { shift }
1;
a work barely in progress... ;)
use strict;
use base 'DBR::Common';
use DBR::Config::Field;
use JSON;
use Data::Dumper;
sub new {
my( $package ) = shift;
my %params = @_;
my $sel
m object: Invalid operation '$_[3]' The ways in which you can use an enum are restricted"}
;
*TO_JSON = \&chunk;
sub id { $_[0][0]->[ v_id ] }
sub handle { $_[0][0]->[ v_handle ] }
sub name
: Invalid operation '$_[3]' The ways in which you can use UnixTime objects is restricted"}
;
*TO_JSON = \&datetime;
sub unixtime { $_[0][0] || '' };
# Using $ENV{TZ} and the posix functions is ugly
t: Invalid operation '$_[3]' The ways in which you can use percent objects is restricted"}
;
*TO_JSON = \&format;
sub value {
return '' unless defined($_[0][0]);
return $_[0][0]
};
sub
}
sub dummy_record{ DUMMY }
sub hashmap_multi { wantarray?():{} }
sub hashmap_single{ wantarray?():{} }
sub next { DUMMY }
sub where { DUMMY }
sub count { 0 }
sub TO_JSON { [] }
1;