From: Blake C. <li...@li...> - 2003-08-17 17:11:55
|
Hi All, I'm still having some troubles getting started changing things on the slashcode. I'm trying to modify new_motd.pl to pull a quote from a table rather than from fortune. Here's what I've done, it returns no errors to me, it just doesn't work. Can anyone spot a problem? use strict; use Slash; use Slash::Utility; use Slash::Constants ':slashd'; use vars qw( %task $me ); $task{$me}{timespec} = '12 * * * *'; $task{$me}{timespec_panic_1} = ''; # not important $task{$me}{code} = sub { my($virtual_user, $constants, $slashdb, $user) = @_; createEnvironment($virtual_user); my $slashdb = getCurrentDB(); my $sth = $slashdb->sqlSelectMany('message', 'motd ORDER BY rand() LIMIT 1'); while(my $row = $sth->fetchrow_hashref()) { $t = $row->{message}"; my $tpid = $slashdb->getTemplateByName("motd", "tpid"); $slashdb->setTemplate($tpid, { template => $t }); } return ; }; 1; -------------- Blake Carver LISNews.com Librarian & Information Science News http://www.lisnews.com |