Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 84e2a7a2d9c49207998aeeff9f4bd7fd > files > 12

perl-Bot-BasicBot-0.890.0-3.mga4.noarch.rpm

#!/usr/bin/perl -w

=head1 NAME

tailbot

=head1 DESCRIPTION

from the fbi bot by richardc, tails a file called 'logfile' to the channel
#tailbot.

=cut

use warnings;
use strict;

package TailBot;
use base 'Bot::BasicBot';

my $channel = '#tailbot';

sub connected {
    my $self = shift;
    $self->forkit({ channel => $channel,
                    run     => [ qw( /usr/bin/tail -f logfile ) ],
                 });
}

package main;

TailBot->new(nick => 'tailbot', channels => [ $channel ])
       ->run;