Modified:
trunk/CPAN/IRC-Bot-Log-Extended/Build.PL
trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl
Log:
small changes on examples/03advanced.pl
Modified: trunk/CPAN/IRC-Bot-Log-Extended/Build.PL
==============================================================================
--- trunk/CPAN/IRC-Bot-Log-Extended/Build.PL (original)
+++ trunk/CPAN/IRC-Bot-Log-Extended/Build.PL Sun Feb 22 21:26:54 2009
@@ -10,7 +10,7 @@
build_requires => {
'Test::More' => 0,
'IRC::Bot' => 0,
- 'Moose' => 0,
+ 'Moose' => '0.70',
},
add_to_cleanup => [ 'IRC-Bot-Log-Extended-*' ],
create_makefile_pl => 'traditional',
Modified: trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl
==============================================================================
--- trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl (original)
+++ trunk/CPAN/IRC-Bot-Log-Extended/examples/03advanced.pl Sun Feb 22
21:26:54 2009
@@ -52,7 +52,6 @@
package IRC::Bot2;
use Moose;
-require IRC::Bot;
extends 'IRC::Bot';
after 'bot_start' => sub {
@@ -76,18 +75,18 @@
my $all = $p->table;
my $pid = 0; # this file's pid
my $please_kill = 0;
+ my $basename = basename($0);
foreach my $one (@$all) {
- my $basename = basename($0);
- if ( $one->cmndline =~ /perl/ and $one->state eq 'defunct' ) {
- $please_kill = 1;
- }
+ if ( $one->cmndline =~ /perl/ and $one->state eq 'defunct' ) {
+ $please_kill = 1;
+ }
if ($one->cmndline =~ /$basename/ and $one->pid != $$) {
- $pid = $one->pid;
- last;
+ $pid = $one->pid;
+ last;
}
}
if ($pid and not $please_kill) {
- return 1;
+ return 1;
}
kill(9, $pid) if $pid;
return 0;