logo       

while() I have a simple question: msg#00340

perl-beginners

Subject: while() I have a simple question

I just ran into an issue where I was loosing literally half of some
expected data, which for a theoretical accounting system, would make for
some interesting audit trails (I already shave a fraction for myself,
but 50% will be noticeable ;)

Is my oversight as simple as knowing that the previous-to-patch while()
statement below is simply throwing the row into $_, and then push()ing
the *next* row into @uledger_entries?

--- ISP/trunk/lib/ISP/Ledger.pm 2009-07-24 01:17:20 UTC (rev 643)
+++ ISP/trunk/lib/ISP/Ledger.pm 2009-07-24 01:21:45 UTC (rev 644)
@@ -235,8 +235,8 @@

my @uledger_entries;

- while ($sth->fetchrow_hashref) {
- push (@uledger_entries, $sth->fetchrow_hashref);
+ while (my $entry_ref = $sth->fetchrow_hashref) {
+ push (@uledger_entries, $entry_ref);
}
return \@uledger_entries;

Steve

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise