Source of template.plp
Back
  1. <(template.plp)>
  2. <:
  3.     BEGIN { $title = 'Overview'; }
  4.     title "PLP"
  5. :>

  6. PLP is yet another Perl embedder, primarily for HTML documents. Unlike with
  7. other Perl embedders, there is no need to learn a meta-syntax or object model:
  8. one can just use the normal Perl constructs. PLP runs under mod_perl for speeds
  9. comparable to those of PHP, but can also be run as a CGI script.<br>
  10. <br>

  11. <: item "NEW VERSION!" :>

  12. The current version of PLP is <:= $PLP::VERSION :>: <a href="/files.plp">download</a> it now!<br>
  13. (PLP 2 users: read <a href="2to3.plp">PLP 2 to 3</a> to learn more about converting old PLP 2 scripts to PLP 3.)<br>
  14. <br>

  15. <: item "Fast and mod_perl!" :>
  16. (April 9, 2002) I'm glad to announce that PLP finally works with mod_perl, and with it, speed is great!
  17. It is two to five (!!) times as fast as PHP with 500 iterations of the following simple script:

  18. <:
  19. code Entity <<'END';
  20. $a = 1;
  21. while ($a < 400000) {
  22.     $a++;
  23. }
  24. END
  25. :>

  26. Now this is of course not a real-life situation, but a 250% speed gain is nice :)<Br>
  27. (Yeah, I know, this site isn't fast, but that's because this server is very loaded)<Br>

  28. <:
  29.     item "Counters and stuff";
  30.     $tel = Counter('count.dat');
  31.     $prev = ReadFile('prev.dat');
  32.     $host = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR};
  33.     WriteFile('prev.dat', $host) if $host ne $prev;
  34. :>

  35. This page has had <:= $tel :> hits since the counter was reset.<br>
  36. The visitor before you was <:= $prev :>, and you are <:= $host :>.<br>
  37. (To view the sourcecode, choose (Source) from the navigation bar)