stuartfreeman has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use vars qw($NAME $VERSION %IRSSI); use Irssi qw(command_bind signal_add_first); $VERSION = "1.03"; %IRSSI = ( authors => "Stuart Freeman", contact => "stuart\@tyro.homelinux.com", name => "greet", description => "Greets your friends with a message from a file nam +ed after them.", license => "GPL" ); sub greet ($server, $channel, $nick, $address) { my ($server, $channel, $nick, $address) = @_; $address =~ s/\~(.*)\@.*/$1/; my $filename = glob( "~/.quotes/$address"); if (-r $filename) { my @quote=split(/\n/,`/usr/games/fortune $filename`); foreach my $quote (@quote) { $server->command('msg '.$channel.' '.$nick.'> +'.$quote); } } } signal_add_first 'message join' => 'greet';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: irssi greeter
by Juerd (Abbot) on Dec 10, 2004 at 19:28 UTC | |
by stuartfreeman (Initiate) on Dec 11, 2004 at 02:22 UTC | |
|
Re: irssi greeter
by Animator (Hermit) on Dec 10, 2004 at 19:32 UTC |