Stories
Slash Boxes
Comments

Slash Open Source Project

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
More | Login
Loading... please wait.
  • [slash@yaz slash]$ perl -MSlash::Test -leDisplay
    [%
    digits = [ 0 .. 9 ];
    anumber = digits.rand _ digits.rand _ digits.rand;
    anumber;
    %]
    ^D
    769
    Note a few things:
    • _ is the concatenation operator in Template Toolkit (I don't recall when it was added, so test first before you use it).
    • The range operator (..) works in Template Toolkit.
    • rand() is a custom scalar op in Slash; it is not provided by Template Toolkit by default, last I checked.
    • Slash::Test is your friend!
    • I don't have Slash::Test :-(
      --
      http://news.DiverseBooks.com/ SF and Computing Book News
      • by pudge (6) on Thursday June 27 2002, @11:40AM (#5042) Homepage
        Slash::Test comes with the latest supported Slash release, 2.2.5. If you are using 2.0.x, well, then I don't think you can use it, but I am not sure, since I don't recall much about 2.0.x.