example.eperl 328 B

12345678910111213141516
  1. <?perl
  2. my $user = 'Erubis';
  3. my @list = ('<aaa>', 'b&b', '"ccc"');
  4. ?>
  5. <p>Hello @{$user}@!</p>
  6. <table>
  7. <tbody>
  8. <?perl $i = 0; ?>
  9. <?perl for $item (@list) { ?>
  10. <tr bgcolor=@!{++$i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'}@">
  11. <td>@!{$i}@</td>
  12. <td>@{$item}@</td>
  13. </tr>
  14. <?perl } ?>
  15. </tbody>
  16. </table>