Added rlimits, support for objects.
[xavierbot.git] / xavierbot.pl.in
index 243dcbc..661c016 100755 (executable)
@@ -2,14 +2,11 @@
 # xavierbot : an OCaml interpreter IRC bot.
 # By Richard W.M. Jones <rich@annexia.org>.
 # This code is in the Public Domain.
-# $Id: xavierbot.pl.in,v 1.2 2007/06/28 20:49:10 rjones Exp $
+# $Id: xavierbot.pl.in,v 1.3 2007/06/28 23:18:28 rjones Exp $
 
 use strict;
-
 use POE qw(Component::IRC Wheel::Run);
 
-$ENV{PATH} = "/usr/bin:/bin";
-
 #----------------------------------------------------------------------
 # Start of configuration.
 
@@ -23,6 +20,8 @@ my $channel = "#ocaml";
 # End of configuration.
 #----------------------------------------------------------------------
 
+$ENV{PATH} = "/usr/bin:/bin";
+
 POE::Session->create (
   package_states => [
     main => [ qw(_default _start irc_001 irc_public got_stdout) ],
@@ -81,9 +80,11 @@ sub irc_public
 
     print "got: $what\n";
     if (my ($stmt) = $what =~ /^\s*([^#].*;;)\s*$/) {
-       print "stmt = $stmt\n";
        $heap->{ocaml}->put ("$stmt\n");
     }
+    elsif ($what =~ /$nick.*restart/) {
+       print STDOUT "got instruction to restart ...\n"
+    }
     undef;
 }