gvs_jagan has asked for the wisdom of the Perl Monks concerning the following question:
Missing right curly or square bracket at jsdisp.cgi line 178, at end of line syntax error at jsdisp.cgi line 178, at EOF
. Execution of jsdisp.cgi aborted due to compilation errors.
I have numbered the left curly brackets in the code with (#1...#12) and the right curly brackets with (#1'...#12').
I request once again for the wisdom of the monks.
thanking in advance , jagan
. code as follows
#!/usr/bin/perl use DBI ; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowsers fatalsToBrowser); my($username) = "someuser"; my($password) = "knownuser"; my($dbh) = DBI->connect ("DBI:mysql:hf", $username , $passwor +d); my($empName) = param("empName"); my($year) = param("year"); my($mon) = param("mon"); my($count) = 0; my($sth , @arr); DBI -> trace(4 , 'dbitrace'); if($year && $mon) { # 1 my($empName) = param("empName"); my($year) = param("year"); my($mon) = param("mon"); if($empName) { #2 my($sth) = $dbh->prepare("select * from jobStat wh +ere cdate> '$year$mon00' AND cdate<'$year($mon++)00' AND empName='$em +pNAme'"); $sth->execute(); @arr = $sth->fetchrow_array() if(defined@arr) { #3 while(@arr=$sth->fetchrow_array()) { #4 $count++; } #4' print <<end_of_html; Content-type: text/html <html><head><title> Job Status Display Page </ +title></head> <body> <readmore> <TABLE BORDER=1 HEIGHT=8%><TR> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>C +urrent Date</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>N +ame</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Allocated</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>A +llocation Date</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>T +arget Date</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Under Execution</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Pending </TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>R +emark </TD> </TR></table></readmore></body></html> end_of_html while(@arr=$sth->fetchrow_array()) { #5 print <<end_of_html; Content-type: text/html <html><head></head> <body><readmore> <TABLE BORDER=0 HEIGHT=8%><TR> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[5]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[8]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[1]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[6]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[7]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[2]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[3]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[4]</TD> </TR> </table> </readmore></body> </ht +ml> end_of_html } # 5' end of while(@arr=$sth->fetchrow_arra +y()) } # 3' end of if(defined@arr) else { #6 print <<end_of_html; Content-type: text/html <html><head><title> Job Status Display Page</t +itle></head> <body> No Record found for $empName for the given dat +es.<p> <a href="/jsdisp.html" > Back </a> </body></html> end_of_html } #6' end of else for if(defined@arr) } #2' if $empName has a value else #7 if empName is null , process the query for year and m +onth { my($sth) = $dbh->prepare("select * from jobStat where + cdate> '$year$mon00' AND cdate<'$year($mon++)00'"); $sth->execute(); @arr = $sth->fetchrow_array() if(defined@arr) { #8 while(@arr=$sth->fetchrow_array()) { #9 $count++; } #9' print <<end_of_html; Content-type: text/html <html><head><title> Job Status Display Page </ +title></head> <body><readmore> <TABLE BORDER=1 HEIGHT=8%><TR> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>C +urrent Date</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>N +ame</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Allocated</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>A +llocation Date</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='center'>T +arget Date</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Under Execution</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>J +ob Pending </TD> <TD WIDTH=15% ALIGN='middle' VALIGN='center'>R +emark </TD> </TR> </table> </body></readmore></html> end_of_html while(@arr=$sth->fetchrow_array()) { #10 # 1) id 2) ja 3) je 4)jp 5) remark 6) +cdate 7) adate 8) tdate 9) empName print <<end_of_html; Content-type: text/html <html><head></head> <body> <readmore> <TABLE BORDER=0 HEIGHT=8%><TR> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[5]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[8]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[1]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[6]</TD> <TD WIDTH=10% ALIGN='middle' VALIGN='c +enter'>$arr[7]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[2]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[3]</TD> <TD WIDTH=15% ALIGN='middle' VALIGN='c +enter'>$arr[4]</TD> </TR> </table></readmore> </body> </ht +ml> end_of_html } #10' end of while(@arr=$sth->fetchrow_ar +ray()) } # 8' end of if(defined@arr) else #else for 2nd if(defined(@arr)) { #11 print <<end_of_html; Content-type: text/html <html><head><title> Job Status Display + Page</title></head> <body> No Record found for the given dates.<p +> <a href="/jsdisp.html" > Back </a> </body></html> end_of_html } # 11' end of else for if(defined@arr) } #7' end of else for if($empName) } #1' end of if($year && $mon) else #if month or year is not given { #12 print <<end_of_html; Content-type: text/html <html><head><title> Job Status Display Page</title></head> <bo +dy> Select year and month. <p> <a href="/jsdisp.html" > Back </a> </body></html> end_of_html } #12'
READMORE tags added by Arunbear
|
|---|