ASP style tags for Perl web development?

It seems to me that I travel 10 years ago, asking about it, but ...

Are there any modules, patches, or any β€œnew” version of Perl (released over the past 10 years) to allow you to write web-based Perl scripts using ASP-style tags?

eg. from ASP / JSP

  some html <% some code%> more HTML

eg. from PHP

  some html <?  some code?> more HTML

Please do not worry about the "why", I ask about it ... This is related to learning a programming language.

+4
source share
4 answers

Yeah. Check out Mason .

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

There is also a Template Toolkit , which simplifies the separation of your template and logical code, but allows you to use many identical designs,

+5
source

Markup::Perl lets you get closer 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> 
+4
source

Embperl supports ASP style tags.

+4
source
+3
source

Source: https://habr.com/ru/post/1306051/


All Articles