# processes all trades which occured between start and end date, calling $action for each one 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()) { &$action($$trdstmt->fetchrow_hashref()); $count++; } return $count; }