Displaying the Slash version inside of a template?
XTaran writes "
Anyone knows how to output the Slash version number inside a template?
I tried (mostly rough guesses after doing a little bit of RTFM with TT2) the following
I tried (mostly rough guesses after doing a little bit of RTFM with TT2) the following
//slashcode.com/article.pl?sid=00/11/23/0054217 //slashcode.com/article.pl?sid= //slashcode.com/article.pl?sid= //slashcode.com/article.pl?sid= //slashcode.com/article.pl?sid=//slashcode.com/ar t icle.pl?sid=
but none of them worked.
//slashcode.com/article.pl?sid=01/09/14/0644229 print $Slash::VERSION; //slashcode.com/article.pl?sid=
probably will work, but TT2's EVAL_PERL isn't set by default inside Slash.
Where can I set EVAL_PERL inside the Slash code?
How much does this slow down Slash?
Are there security issues with EVAL_PERL? (I guess so.)"
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.



Escaping Bug? (Score:1)
There seems to be a bug inside index.pl and article.pl, because I had TT2 code inside my posting, which looked fine in the preview at submit.pl, but looks now horrible in index.pl and article.pl.
IMHO neither submit.pl nor index.pl and article.pl should execute TT2 statements inside article bodies. (Perhaps some of the SlashCode authors can escape that code inside the article. Thanks.)
-- There is no place like $HOME
Re:Escaping Bug? (Score:2)
1. Template code is not being executed. What is happening is that your text is being swallowed by a thing that allows authors to do things like <A HREF="[% perl %]"> to get the URL of the most recent article about "perl". That's why you see those URLs. This is a bug, IMO, because the way it is written, it is impossible to put template code in the URLs.
I've filed a bug [sourceforge.net] if you are interested in following it.
2. If you do [% USE Slash; Slash.VERSION %] you can, right now, get a version. But it is of Slash::Display::Plugin, not Slash itself. D'oh. I am adding a method version (lowercase) to give you the Slash version (which in my case is 2.1.0, or 2.00100). Witness:
$ perl -MSlash::Test=slash -leDisplay
[% USE Slash; Slash.VERSION; "\n"; Slash.version %]
1.2
2.001000
(By the way, Slash::Test, in slash 2.2, is really cool for debugging and testing stuff in Slash.