sub processTrades { my ($self,$action) = @_; my $count = 0; my $trdstmt = $self->_getTradesStatement(); $trdstmt->bind_param(1,$self->{'startdate'}); $trdstmt->bind_param(2,$self->{'enddate'}); $trdstmt->execute(); while(my $trade = $trdstmt->fetchrow_hashref()) { # Debug # use Data::Dumper; print STDERR Dumper($trade); # /Debug # &$action($trade); #Corrected# $count++; } return $count; }