package Templog; use Milkbone; # print `pwd`; register_hook("buddy_in", sub { return unless $ARGS{-buddy} =~ /tiff/i; open(LOG, "log.txt"); print LOG "$ARGS{-buddy} logged in at " . time . "\n\n"; }); register_hook("buddy_out", sub { return unless $ARGS{-buddy} =~ /tiff/i; open(LOG, "log.txt"); print LOG "$ARGS{-buddy} logged out at " . time . "\n\n"; }); register_hook("msg_in", sub { open(LOG, "log.txt"); print LOG "$ARGS{-user} sent this at " . time . ": $ARGS{-msg}\n\n"; });