Embperl - building dynamic websites with Perl


Example for generating a serial letter from a database
[ << Prev: DESCRIPTION ] [ Content ] [ Next: Methods >> ]
  use DBIx::Recordset ;
  use Embperl ;

  *set = DBIx::Recordset -> Search({'!DataSource' => $db, '!Table' => 'address', '!WriteMode' => 0}) ;

  die DBIx::Recordset -> LastError if (DBIx::Recordset -> LastError) ;

  Embperl::Execute ({'inputfile' => 'address.rtf', param => \@set, syntax => 'RTF'}) ;
  # if your database table contains fields 'name' and 'street' you can now simply insert a
  # fields call 'name' and 'street' in your RTF file and Embperl will repeat the document
  # until all records are outputed

[ << Prev: DESCRIPTION ] [ Content ] [ Next: Methods >> ]


© 1997-2023 Gerald Richter / actevy