}
my @res;
- my $want = wantarray();
- if (not defined $want) {
+ if (not defined wantarray) {
$self->next::method( \%upd, @_ );
}
- elsif ($want) {
+ elsif (wantarray) {
@res = $self->next::method( \%upd, @_ );
}
else {
}
$guard->commit;
- return $want ? @res : $res[0];
+ return wantarray ? @res : $res[0];
}
}
$self->move_last;
my @res;
- my $want = wantarray();
- if (not defined $want) {
+ if (not defined wantarray) {
$self->next::method( @_ );
}
- elsif ($want) {
+ elsif (wantarray) {
@res = $self->next::method( @_ );
}
else {
}
$guard->commit;
- return $want ? @res : $res[0];
+ return wantarray ? @res : $res[0];
}
=head1 METHODS FOR EXTENDING ORDERED
my $self = shift;
my $rs = $self->search_rs( @_ );
- my $want = wantarray;
- if ($want) {
+ if (wantarray) {
return $rs->all;
}
- elsif (defined $want) {
+ elsif (defined wantarray) {
return $rs;
}
else {
$self->throw_exception($error); # txn failed but rollback succeeded
};
- return $wantarray ? @return_values : $return_value;
+ return wantarray ? @return_values : $return_value;
}
=head2 txn_begin
local $self->{_in_dbh_do} = 1;
my @result;
- my $want_array = wantarray;
+ my $want = wantarray;
my $tried = 0;
while(1) {
try {
$self->txn_begin;
my $txn_start_depth = $self->transaction_depth;
- if($want_array) {
+ if($want) {
@result = $coderef->(@$args);
}
- elsif(defined $want_array) {
+ elsif(defined $want) {
$result[0] = $coderef->(@$args);
}
else {
$exception = $_;
};
- if(! defined $exception) { return $want_array ? @result : $result[0] }
+ if(! defined $exception) { return wantarray ? @result : $result[0] }
if($self->transaction_depth > 1 || $tried++ || $self->connected) {
my $rollback_exception;
);
my @ret;
- my $wa = wantarray;
- if ($wa) {
+ if (wantarray) {
@ret = $tr->translate;
}
else {
$self->throw_exception( 'Unable to produce deployment statements: ' . $tr->error)
unless (@ret && defined $ret[0]);
- return $wa ? @ret : $ret[0];
+ return wantarray ? @ret : $ret[0];
}
sub deploy {
my ($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) = @_;
my (@res, $tried);
- my $wantarray = wantarray();
+ my $want = wantarray;
my $next = $self->next::can;
do {
try {
my $exec = sub { $self->$next($dbh, $op, $extra_bind, $ident, $bind_attributes, @args) };
- if (!defined $wantarray) {
+ if (!defined $want) {
$exec->();
}
- elsif (! $wantarray) {
+ elsif (! $want) {
$res[0] = $exec->();
}
else {
};
} while (! $tried++);
- return $wantarray ? @res : $res[0];
+ return wantarray ? @res : $res[0];
}
=head2 get_autoinc_seq
around connect_info => sub {
my ($next, $self, $info, @extra) = @_;
- my $wantarray = wantarray;
-
my $merge = Hash::Merge->new('LEFT_PRECEDENT');
my %opts;
$self->_master_connect_info_opts(\%opts);
- my (@res, $res);
- if ($wantarray) {
+ my @res;
+ if (wantarray) {
@res = $self->$next($info, @extra);
} else {
- $res = $self->$next($info, @extra);
+ $res[0] = $self->$next($info, @extra);
}
# Make sure master is blessed into the correct class and apply role to it.
# link pool back to master
$self->pool->master($master);
- $wantarray ? @res : $res;
+ wantarray ? @res : $res[0];
};
=head1 METHODS
$self->read_handler($current);
};
- return $want_array ? @result : $result[0];
+ return wantarray ? @result : $result[0];
}
=head2 set_reliable_storage
my $self = shift;
my ($source, $fields, $where, @rest) = @_;
- my $wantarray = wantarray;
-
my $blob_cols = $self->_remove_blob_cols($source, $fields);
my $table = $source->name;
my @res;
if (%$fields) {
- if ($wantarray) {
+ if (wantarray) {
@res = $self->next::method(@_);
}
- elsif (defined $wantarray) {
+ elsif (defined wantarray) {
$res[0] = $self->next::method(@_);
}
else {
$guard->commit;
- return $wantarray ? @res : $res[0];
+ return wantarray ? @res : $res[0];
}
sub insert_bulk {