Slash::Test - Command-line Slash testing
% perl -MSlash::Test -wle Display
Current user is [% user.nickname %] ([% user.uid %])
^DCurrent user is Anonymous Coward (1)
% perl -MSlash::Test -e 'print Dumper $user'
% perl -MSlash::Test=virtualuser -e 'print Dumper $user'
#!/usr/bin/perl -w
use Slash::Test qw(virtualuser);
print Dumper $user;
Will export everything from Slash, Slash::Utility, Slash::Display, Slash::XML, and Data::Dumper into the current namespace. Will export $user, $form, $constants, and $slashdb as global variables into the current namespace.
So use it one of three ways (use the default Virtual User, or pass it in via the import list, or pass in with slashTest()), and then just use the Slash API in your one-liners.
It is recommended that you change the hardcoded default to whatever Virtual User you use most.
slashTest([VIRTUALUSER])Set up the environment, with a new Virtual User.
Called automatically when module is first used. Should only be called if changing the Virtual User from the default (by default, ``slash''). Called without an argument, uses the default.
A wrapper for slashDisplay(). Pass in a template string (not a template name) and optional hashref of variables. Nocomm is true. Default is to print (else make third param true).
If first arg is false, then takes template from STDIN. You can type in your template on the command line, then, and hit ctrl-D or whatever to end.
Slash(3).
$Id: Test.pm,v 1.1.2.7 2001/08/28 21:39:31 pudge Exp $