POE::C...lowTail(3pm)
π POE::Component::IRC::Plugin::FollowTail π
okay bestie, welcome to the User Contributed Perl Documentation for POE::C...lowTail (3pm) β yes the name got chopped in the corner, it's a whole mood, we move. This is the page about a lil PoCo-IRC plugin that follows the tail of an ever-growing file. She's nosy. She's loyal. She's iconic. π¦
β¨ NAME β¨
POE::Component::IRC::Plugin::FollowTail β a PoCo-IRC plugin that follows the tail of an ever-growing file. no cap, that's literally the whole job. π
β¨ SYNOPSIS β¨
here's the vibe, copy-paste ready, not a single character touched because we respect the code:
use POE qw(Component::IRC Component::IRC::Plugin::FollowTail);
my $nickname = 'Flibble' . $$;
my $ircname = 'Flibble the Sailor Bot';
my $ircserver = 'irc.blahblahblah.irc';
my $filename = '/some/such/file/here';
my @channels = ( '#Blah', '#Foo', '#Bar' );
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_start irc_001 irc_tail_input irc_tail_error irc_tail_reset) ],
],
);
$poe_kernel->run();
sub _start {
$irc->plugin_add( 'FollowTail' => POE::Component::IRC::Plugin::FollowTail->new(
filename => $filename,
));
$irc->yield( register => 'all' );
$irc->yield( connect => { } );
return;
}
sub irc_001 {
$irc->yield( join => $_ ) for @channels;
return;
}
sub irc_tail_input {
my ($kernel, $sender, $filename, $input) = @_[KERNEL, SENDER, ARG0, ARG1];
$kernel->post( $sender, 'privmsg', $_, "$filename: $input" ) for @channels;
return;
}
sub irc_tail_error {
my ($kernel, $sender, $filename, $errnum, $errstring)
= @_[KERNEL, SENDER, ARG0 .. ARG2];
$kernel->post( $sender, 'privmsg', $_, "$filename: ERROR: $errnum $errstring" ) for @channels;
$irc->plugin_del( 'FollowTail' );
return;
}
sub irc_tail_reset {
my ($kernel, $sender, $filename) = @_[KERNEL, SENDER, ARG0];
$kernel->post( $sender, 'privmsg', $_, "$filename: RESET EVENT" ) for @channels;
return;
}
like, look at her go. _start sets it up, irc_tail_input gossips every new line to your channels, irc_tail_error panics adorably and then dips out, irc_tail_reset announces the reset. periodt. π
β¨ DESCRIPTION β¨
POE::Component::IRC::Plugin::FollowTail is a POE::Component::IRC plugin that uses POE::Wheel::FollowTail to follow the end of an ever-growing file. πΎ
She generates "irc_tail_" prefixed events for each new record that gets appended to her file. so like, every time something new lands at the bottom of the file, she's like "bestie I have NEWS" and fires off an event. it's giving dedicated. πΈ
β¨ METHODS β¨
π new
Takes two arguments, and here's the tea:
'filename'β the name of the file to tail, and she's mandatory, no skipping. π¨'filter'β aPOE::Filterobject to pass toPOE::Wheel::FollowTail, and this one's optional. π«Ά
Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. that's the whole thing, she's low maintenance fr fr.
β¨ OUTPUT EVENTS β¨
the plugin generates the following additional POE::Component::IRC events, and ngl this is the good part:
π¦ "irc_tail_input"
Emitted for every complete record read. "ARG0" will be the filename, and "ARG1" the record which was read. so ARG1 is literally the new content, go off. π₯
π¦ "irc_tail_error"
Emitted whenever an error occurs. "ARG0" will be the filename, and "ARG1" and "ARG2" hold numeric and string values for $!, respectively. that's your errno and your error message, cute lil pair. π
π¦ "irc_tail_reset"
Emitted every time a file is reset. "ARG0" will be the filename. she noticed, she's telling you, that's friendship. π
β¨ AUTHOR β¨
Chris 'BinGOs' Williams β king behavior, we stan. π
β¨ SEE ALSO β¨
POE::Component::IRCPOE::Wheel::FollowTail
go read those too, iykyk. β
and that's the page bestie!! this whole thing lives underperl v5.40.1, dated2025-08-21, and it answers to the namePOE::C...lowTail(3pm) down in the footer. go tail something and slay. πβ¨πππ
π¦ where this page comes from
- ubuntu resolute: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms