From 665470fabcd881eaf1b01008866e1da84f9c073a Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 13 Mar 2007 05:17:23 +0000 Subject: LedgerSMB.pm now uses strict git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@889 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 7f1306ff..6a929b47 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -35,6 +35,7 @@ use Math::BigFloat lib=>'GMP'; use LedgerSMB::Sysconfig; +use strict; package LedgerSMB; @@ -366,11 +367,11 @@ sub callproc { $argstr .= "?, "; } $argstr =~ s/\, $//; - $query = "SELECT * FROM $procname()"; + my $query = "SELECT * FROM $procname()"; $query =~ s/\(\)/($argstr)/; my $sth = $self->{dbh}->prepare($query); $sth->execute(@_); - while (my $ref = $sth->fetchrow_hashref(NAME_lc)){ + while (my $ref = $sth->fetchrow_hashref('NAME_lc')){ push @results, $ref; } @results; @@ -380,6 +381,7 @@ sub datetonum { my ($self, $myconfig, $date, $picture) = @_; + my ($yy, $mm, $dd); if ($date && $date =~ /\D/) { if ($myconfig->{dateformat} =~ /^yy/) { @@ -423,7 +425,7 @@ sub db_init { my $sth = $self->{dbh}->prepare($query); $sth->execute; my $ref; - while ($ref = $sth->fetchrow_hashref(NAME_lc)){ + while ($ref = $sth->fetchrow_hashref('NAME_lc')){ push @{$self->{custom_db_fields}{$ref->{extends}}}, $ref->{field_def}; } @@ -434,7 +436,7 @@ sub dbconnect_noauto { my ($self, $myconfig) = @_; # connect to database - $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, {AutoCommit => 0}) or $self->dberror; + my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, {AutoCommit => 0}) or $self->dberror; # set db options if ($myconfig->{dboptions}) { @@ -456,6 +458,7 @@ sub redo_rows { } my $i = 0; + my $j; # fill rows foreach my $item (sort { $a->{num} <=> $b->{num} } @ndx) { $i++; -- cgit v1.2.3