I'm writing a flat-file publications databse CGI and I'm recieving an compilation error on the lines indicated below, any ideas??
Any help would be more than welcome.
if ($#results >= 0) { //line 135
foreach $record (@results) {
chomp($record);
($author,$year,$title,$journal,$conf_name,$city,$volume,$issue,$pages,
+$institution,$date,$type,$publisher,$edition,$translator,$scale,$call
+_num,$label,$abstract,$notes,$isbn,$url,$editor,$keywords) = split(/\
+|/,$record);
if ($title ne ""){
print "Title: $title\n";}
if ($author ne ""){
print "Author: $author\n";}
if ($year ne ""){
print "Year: $year\n";}
if ($journal ne ""){
print "Journal: $journal\n";}
if ($conf_name ne ""){
print "Conference: $conf_name\n";}
if ($city ne ""){
print "City: $city";}
if ($volume ne ""){
print "Volume: $volume\n";}
if ($issue ne ""){
print "Issue: $issue\n";}
if ($pages ne ""){
print "Pages: $pages\n";}
if ($institution ne ""){
print "Institution: $institution\n";}
if ($date ne ""){
print "Date: $date\n";}
if ($type ne ""){
print "Type: $type\n";}
if ($publisher ne ""){
print "Publisher: $publisher\n";}
if ($edition ne ""){
print "Edition: $edition\n";}
if ($translator ne ""){
print "Translator: $translator\n";}
if ($scale ne ""){
print "Scale: $scale\n";}
if ($call_num ne ""){
print "Call Number: $call_num\n";}
if ($label ne ""){
print "Label: $label\n";}
if ($abstract ne ""){
print "Abstract: $abstract\n";}
if ($notes ne ""){
print "Notes: $notes\n";}
if ($isbn ne ""){
print "ISBN/ISSN: $isbn\n";}
if ($url ne ""){
print "URL: $url\n";}
if ($editor ne ""){
print "Editor: $editor\n";}
} //line 187
}
The errors are as follows:
syntax error at line 135 near ") {"
syntax error at line 187 near "}"
lines are marked in the scrip selection. Thanks!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.