RPrinceton
Programmer
Hi,
The block of code between .a and .b works fine, the block of code between .c and .d fails with:
Bad switch statement (problem in the code block?) near PoolMaint.pl line 331. The only difference between the two is how I have indented the code in the script. The error isn't even close to the line number where this code is. It's almost as though Perl has some restriction or quirk with regard to indentation. Please advise. Thanks in advance. Regards, Randall Princeton
.a
sub getSeasonYear()
{
$sql = qq{SELECT * FROM $mvTblNM WHERE @mvWhere};
$sth = $dbh->prepare($sql);
$sth->execute($mvCntlKeyNbrQual,$mvCntlKeyTxtQual);
chkDBSelect();
$sth->bind_columns(undef,\$mvCntlKey,
\$mvCntlKeyNbrQual,
\$mvCntlKeyTxtQual,
\$mvCntlDesc,
\$mvCntlBegDT,
\$mvCntlEndDT,
\$mvCntlValu);
while ($sth->fetch())
{
print LOG "DB Record follows\n";
print LOG "CntlKey: $mvCntlKey\n";
print LOG "CntlNbr: $mvCntlKeyNbrQual\n";
print LOG "CntlTxt: $mvCntlKeyTxtQual\n";
print LOG "CntlDsc: $mvCntlDesc\n";
print LOG "CntlBDT: $mvCntlBegDT\n";
print LOG "CntlEDT: $mvCntlEndDT\n";
print LOG "CntlVal: $mvCntlValu\n";
}
}
.b
.c
sub getSeasonYear()
{
$sql = qq{SELECT * FROM $mvTblNM WHERE @mvWhere};
$sth = $dbh->prepare($sql);
$sth->execute($mvCntlKeyNbrQual, $mvCntlKeyTxtQual);
chkDBSelect();
$sth->bind_columns(undef,\$mvCntlKey,
\$mvCntlKeyNbrQual,
\$mvCntlKeyTxtQual,
\$mvCntlDesc,
\$mvCntlBegDT,
\$mvCntlEndDT,
\$mvCntlValu);
while ($sth->fetch())
{
print LOG "DB Record follows\n";
print LOG "CntlKey: $mvCntlKey\n";
print LOG "CntlNbr: $mvCntlKeyNbrQual\n";
print LOG "CntlTxt: $mvCntlKeyTxtQual\n";
print LOG "CntlDsc: $mvCntlDesc\n";
print LOG "CntlBDT: $mvCntlBegDT\n";
print LOG "CntlEDT: $mvCntlEndDT\n";
print LOG "CntlVal: $mvCntlValu\n";
}
}
.d
The block of code between .a and .b works fine, the block of code between .c and .d fails with:
Bad switch statement (problem in the code block?) near PoolMaint.pl line 331. The only difference between the two is how I have indented the code in the script. The error isn't even close to the line number where this code is. It's almost as though Perl has some restriction or quirk with regard to indentation. Please advise. Thanks in advance. Regards, Randall Princeton
.a
sub getSeasonYear()
{
$sql = qq{SELECT * FROM $mvTblNM WHERE @mvWhere};
$sth = $dbh->prepare($sql);
$sth->execute($mvCntlKeyNbrQual,$mvCntlKeyTxtQual);
chkDBSelect();
$sth->bind_columns(undef,\$mvCntlKey,
\$mvCntlKeyNbrQual,
\$mvCntlKeyTxtQual,
\$mvCntlDesc,
\$mvCntlBegDT,
\$mvCntlEndDT,
\$mvCntlValu);
while ($sth->fetch())
{
print LOG "DB Record follows\n";
print LOG "CntlKey: $mvCntlKey\n";
print LOG "CntlNbr: $mvCntlKeyNbrQual\n";
print LOG "CntlTxt: $mvCntlKeyTxtQual\n";
print LOG "CntlDsc: $mvCntlDesc\n";
print LOG "CntlBDT: $mvCntlBegDT\n";
print LOG "CntlEDT: $mvCntlEndDT\n";
print LOG "CntlVal: $mvCntlValu\n";
}
}
.b
.c
sub getSeasonYear()
{
$sql = qq{SELECT * FROM $mvTblNM WHERE @mvWhere};
$sth = $dbh->prepare($sql);
$sth->execute($mvCntlKeyNbrQual, $mvCntlKeyTxtQual);
chkDBSelect();
$sth->bind_columns(undef,\$mvCntlKey,
\$mvCntlKeyNbrQual,
\$mvCntlKeyTxtQual,
\$mvCntlDesc,
\$mvCntlBegDT,
\$mvCntlEndDT,
\$mvCntlValu);
while ($sth->fetch())
{
print LOG "DB Record follows\n";
print LOG "CntlKey: $mvCntlKey\n";
print LOG "CntlNbr: $mvCntlKeyNbrQual\n";
print LOG "CntlTxt: $mvCntlKeyTxtQual\n";
print LOG "CntlDsc: $mvCntlDesc\n";
print LOG "CntlBDT: $mvCntlBegDT\n";
print LOG "CntlEDT: $mvCntlEndDT\n";
print LOG "CntlVal: $mvCntlValu\n";
}
}
.d