From f186d182a75a466f1c4b6d26534e402ccd6c66cf Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Wed, 12 Oct 2011 17:28:04 -0400 Subject: [PATCH] use strict and warnings, and clean up problems it found. --- trial-balance-report.plx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trial-balance-report.plx b/trial-balance-report.plx index f5b2620..4dac912 100755 --- a/trial-balance-report.plx +++ b/trial-balance-report.plx @@ -20,6 +20,9 @@ # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor # Boston, MA 02110-1301, USA. +use strict; +use warnings; + use Math::BigFloat; my $LEDGER_CMD = "/usr/bin/ledger"; @@ -56,7 +59,7 @@ while (my $negLine = ) { $amount = ParseNumber($amount); $account =~ s/^\s+//; $account =~ s/\s+$//; - $acc{$account}{negative} = $amount; + $acct{$account}{negative} = $amount; } close LEDGER_NEGATIVE; die "error($0): $! while running negative_ledger command line" unless ($? == 0); @@ -97,7 +100,7 @@ foreach my $account (keys %acct) { $acct{$account}{negative}, $acct{$account}{postiive}); } -print sprintf("%${ACCT_WIDTH}s \$%-.2d \$%-2.d\n", TOTAL, $totNeg, $totPos); +print sprintf("%${ACCT_WIDTH}s \$%-.2d \$%-2.d\n", 'TOTAL', $totNeg, $totPos); ############################################################################### # # Local variables: