I'm running the sample in the Intro to DBIx::Recordset.  It's not too happy! 

[1081]ERR: 24: Error in Perl code: syntax error at 
/www/htdocs/admin/test_rs.epl line 46, at EOF 
    syntax error at /www/htdocs/admin/test_rs.epl line 49, near "#line 49 
"/www/htdocs/admin/test_rs.epl" 
    } else"

[1081]ERR: 24: test_rs.epl(1): Error in Perl code: 

Apache/1.3.23 (Unix) mod_perl/1.26 HTML::Embperl 2.0b5 [Thu Feb 14 
14:15:25 2002]



Here's the source epl file:

<html> <head> <title>Database Access with HTML::Embperl and 
DBIx::Recordset</title> </head> <body> 

  [-
  ### Database-parameter ###
  use DBIx::Recordset ;
  $fdat{'!DataSource'} = 'DBI:Sprite:/www/db/Annual_Review';
  $fdat{'!Username'} = '-------';
  $fdat{'!Password'} = '-------';
  $fdat{'!Table'} ||= 'ar_events';
  $fdat{'!PrimKey'} = 'keynum' ;
  $fdat{'$max'}     = 10 ;

  ### Execute action according to the query parameters ###
  *set = DBIx::Recordset -> Execute (\%fdat) ;
  -]

  [$if $DBI::errstr $]
        <h1>Database Error [+ $DBI::errstr +]</h1>
  [$else$]
    [-$names = $set -> AllNames ; -]
    [$if $set[0] && $set -> MoreRecords $]
      [### We found more then one record ###]
      [### -> display as a table         ###]
      <table>
        <tr>  [### Display header ###]
          <th>[+ ucfirst ($names -> [$col]) +]</th>
        </tr>
        <tr>  [### Display record -> Table will be expanded by Embperl ###]
          [- $rec = $set[$row] -]
          <td>
            [- $name = $names -> [$col] -]
            [$if $name eq $fdat{'!PrimKey'} $]
              [### Generate HTML link to edit this record ###]
              <a href="example4.htm?!Table=[+ $fdat{'!Table'} +]&[+ 
$fdat{'!PrimKey'} +]=[+ $rec ->{$fdat{'!PrimKey'}} +]">[+ $rec -> {$name} 
+]</a>
            [$elsif $set -> Link4Field($name) $]
              [### Link to other table -> generate HTML link ###]
              [- $link = $set -> Link($set -> Link4Field($name)) -]
              <a href="example4.htm?!Table=[+ $link -> {'!Table'} +]&[+ $link -> 
{'!LinkedField'} +]=[+ $rec -> {$link -> {'!MainField'}} +]">[+$rec -> 
{$name}+]</a>
            [$else$] 
              [### Display contents of field ###]
              [+ $rec -> {$names->[$col]} +]
            [$endif$]
            </td>
        </tr>
      </table>
      [+ $set -> PrevNextForm ('\<\<Prev', 'Next\>\>', \%fdat) ; +]
      <hr>
      <a href="example4.htm?!Table=[+ $fdat{'!Table'} 
+]&%3dempty=1">Search</a> record in table '[+ $fdat{'!Table'} +]' 
    [$else$]
      [### We found no/one record(s) ###]
      [### -> Display form          ###]
      <form>
        <table>
        <tr>
          [- $name = $names -> [$row] -]
          <td> [### Display fieldname ###]
            [+ ucfirst ($name) +]
          </td>
          <td> [### Display content of field ###]
            <input type=text name="[+ $name +]" value="[+ $set{$name} +]">
            [$if $set -> Link4Field($name) $]
              [### Link to other table -> generate HTML link ###]
              [- $link = $set -> Link($set -> Link4Field($name)) -]
              <a href="example4.htm?!Table=[+ $link -> {'!Table'} +]&[+ $link -> 
{'!LinkedField'} +]=[+ $set{$link -> {'!MainField'}} +]">Show record from table 
'[+ $link -> {'!Table'} +]'</a>
            [$endif$]
          </td>
        </tr>
        </table>
        [### Buttons for the different actions, the "name" attribute determinates 
###]
        [###  which action should be taken                                        ###]
        <input type=submit name="=search" value="Search">
        <input type=submit name="=empty"  value="New">
        <input type=submit name="=insert" value="Add">
        <input type=submit name="=update" value="Update">
        <input type=submit name="=delete" value="Delete">
        <input type=hidden name="!Table"  value="[+ $fdat{'!Table'} +]">
      </form>
    [$endif$]
  [$endif$]
</body>
</html>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to