package Speak; use Milkbone; use Win32::OLE qw( EVENTS ); my $DirectSS = new Win32::OLE( "{EEE78591-FE22-11D0-8BEF-0060081841DE}" ) or die "$!"; sub say { my $say = shift; $DirectSS->Speak($say); while( $DirectSS->{Speaking} ) { Win32::OLE->SpinMessageLoop(); Win32::Sleep( 100 ); } } register_hook("msg_in", sub { say("You have a message from $ARGS{-user}"); });