package Plugins::TextCommands; use strict; use lib qw(/home/www/web33/html/cgi-bin/test/); use File::ReadBackwards; return bless({ command_handlers => { 'texts' => \&texts_handler, }, }); sub texts_handler { my($self,$main,$command,$text) = @_; my @ret=(); my $file = './Variables/messages.log'; my $frb = File::ReadBackwards->new( $file ) or die "can't read $file $!"; for(0..9) { my $output = $main->createOutput( { template => 'xyz', texts => $frb->readline(), nick => $main->{current_user}{nick}, color => $main->{current_user}{color}, text => $main->toHTML($text), }); $output->restrictToCurrentRoom; push @ret,$output; return \@ret; } }