use Xchat qw(:all); hook_server( "005", sub { if($_[1][0] =~ s/CAPAB //) { command("RECV $_[1][0]"); return EAT_ALL} else { return EAT_NONE } } );