hsweet has asked for the wisdom of the Perl Monks concerning the following question:
Hi all
I'm having a problem with a program that reads from one database and writes to a 2nd. I did not write it. One thing I want to see if it reads correctly from db#1. Far as I can tell, $action is an anonymous sub. I'd like to see what that is returning and then what is or is not getting pulled from the db by the fetchrow->hashref() bit.
# processes all trades which occured between start and end date, calli +ng $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; }
Time flies like an arrow, fruit flies like bananas
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dumper dereferencing problem
by bluescreen (Friar) on Jul 23, 2010 at 14:08 UTC | |
|
Re: Dumper dereferencing problem
by kennethk (Abbot) on Jul 23, 2010 at 14:04 UTC | |
|
Re: Dumper dereferencing problem
by roboticus (Chancellor) on Jul 23, 2010 at 15:52 UTC |