views:

75

answers:

4

I feel like I'm traveling 10 years back in time by asking this, but...

Are there any modules, patches, or any "new" version of Perl (released in the last 10 years) to enable writing web-oriented Perl scripts using ASP-style tags?

e.g. from ASP/JSP

 some html <% some code %> more HTML

e.g. from PHP

 some html <? some code ?> more HTML

Please don't worry about "why" I'm asking this... It's related to programming language research.

+5  A: 

Yep. Check out Mason.

You can install it from CPAN with cpan -i HTML::Mason.

There's also Template Toolkit, which makes it a bit easier to separate your template and logic code, but allows a lot of the same constructs.

friedo
this is the closest one to what I was looking for... thanks!
Alex R
+4  A: 

Markup::Perl gets you pretty close to PHP/ASP style programming in Perl.

  # don't write this...
  print "Content-type: text/html;\n\n";
  print "<html>\n<body>\n";
  print "<p>\nYour \"lucky number\" is\n";
  print "<i>", int rand 10, "</i>\n</p>\n";
  print "</body>\n</html>\n";

  # write this instead...
  use Markup::Perl;
  <html>
  <body>
  <p>
  Your "lucky number" is
  <i><perl> print int rand 10 </perl></i>
  </p>
  </body>
  </html>
mobrule
Google `"PerlHP"` for the sordid history of `Markup::Perl
mobrule
Other answers are correct but the above comment was the most entertaining...
Alex R
+3  A: 

There's Apache::ASP and Apache2::ASP

runrig
+4  A: 

Embperl does support ASP style tags.

Sinan Ünür
Stop reading my mind!!! :) +1 for answering with what I just wanted to :)
DVK