Re: [MacPerl-WebCGI] well split!!!

[email protected] Wed, 7 Mar 2001 09:43:03 -0500
Newsgroups perl.macperl.webcgi
Message-ID <p05010400b6cbf75980b1@[64.194.142.225]>
- Bruce:

While the code you suggested still doesn't do what I want ( I'll 
discuss that problem later), you did present something else to 
consider. Please note that the following code runs without error:

open(DATA,$datafile) || &open_error($datafile);
   while (<DATA>) {
     next if /^$/;
     my ($database_id, $category, $variable_name, $price, 
$description, $item_number) = split(/\t/);

     print "<TR>";
     print "<TD>$variable_name</TD>";
     print "<TD>$description</TD>";
     print "</TR>";
}

However, the following code generates an error:

open(DATA,$datafile) || &open_error($datafile);
   while (<DATA>) {
     next if /^$/;
     my ($database_id, $category, $variable_name, $price, 
$description, $item_number) = split(/\t/);

    print <<ROW;
    <TR>
    <TD>$variable_name</TD>
    <TD>$description</TD>
    </TR>
    ROW
}

Why?

tedd
-- 
http://sperling.com/