⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
perl-Regexp-Assemble
/
examples
/
View File Name :
ircwatcher
/usr/bin/perl -w # # ircwatcher - watch an IRC stream and do things when # interesting things occur # # This script demonstrates the use of dispatch table. One # regular expression matching everthing, and then handing # off the captured submatches to a callback. # # Try changing the read of STDIN to DATA for a quick demo. # # Acknowledgements to David "Sniper" Rigaudière for the # idea. # # Copyright (C) David Landgren 2005 use strict; use Regexp::Assemble; my %dispatch = ( '^\*\*\* (\S+) joined channel (\S+)$' => \&joined, '^\*\*\* (\S+) left channel (\S+) reason (.*)$' => \&left, '^q$' => sub { exit }, ); my $re = Regexp::Assemble->new ->track(1) ->add(keys %dispatch); sub joined { my ($who, $channel) = @_; print "$who joined $channel\n"; } sub left { my ($who, $channel, $reason) = @_; print "$who left $channel saying $reason\n"; } while(
) { chomp; if ($re->match($_)) { $dispatch{$re->matched}->($re->capture); } else { print "ignored <$_>\n"; } } __DATA__ *** david joined channel foo hello *** david left channel bar reason that's all folks q