Re: Can perl be injected on html pages?
by Corion (Patriarch) on Mar 30, 2009 at 10:59 UTC
|
| [reply] |
|
i saw a little about mod_perl but tis way more difficult in comparison with php. Is there a php type of approach with perl? (not that i like php better)
| [reply] |
|
| [reply] |
|
|
Re: Can perl be injected on html pages?
by dsheroh (Monsignor) on Mar 30, 2009 at 15:26 UTC
|
Mason seems to be the most commonly-used "Perl embedded in HTML" option at the moment, although I seem to recall that you can do it with Template::Toolkit as well (even if the TT folks don't like to admit to it).
But, as already mentioned, mixing logic with presentation like this is generally discouraged and is arguably the primary reason why PHP code has such a bad reputation as an unstructured mess. While it does work OK if you're just going to do something trivial like inserting a counter, it makes things much more difficult when you start trying to do anything more complex, so it's not a good habit to get into. | [reply] |
Re: Can perl be injected on html pages?
by jettero (Monsignor) on Mar 30, 2009 at 11:56 UTC
|
I've used Embperl with success, but not since 2002.
| [reply] |
Re: Can perl be injected on html pages?
by chrisv (Initiate) on Mar 30, 2009 at 13:07 UTC
|
HTML::Mason
http://www.masonbook.com
http://masonhq.com
-chrisv | [reply] |
|
| [reply] |
Re: Can perl be injected on html pages?
by sundialsvc4 (Abbot) on Mar 30, 2009 at 12:42 UTC
|
It is possible to accomplish this through regular-expressions ... searching for placeholders, extracting them, evaling the extracted text and substituting it back into the text. But as an architectural design I do not like this “commingling of concerns” and do not recommend it.
| |
Re: Can perl be injected on html pages?
by Bloodnok (Vicar) on Mar 30, 2009 at 12:45 UTC
|
Doesn't AS support something called perlscript ... or the like, for just such a purpose ?
Admittedly tho', that does however pander to the M$ unique way of doing things...
A user level that continues to overstate my experience :-))
| [reply] |
|
Perlscript, now there is something I haven't heard of in a long time!
That was a browser plugin that let people execute Perl clientside. It required that people be using IE, and that they install the plugin, and then gave you nothing you couldn't get just as easily and far more portably with JavaScript.
Unlike PHP and every Perl templating system that has been mentioned it did not have any access to anything on the server side.
| [reply] |