use strict; use Irssi qw( command_bind print ); use constant PREFIX => '%c# %n '; command_bind( peek => sub { my ( $data, $server, $window ) = @_; print PREFIX; print PREFIX.qq(Searching users for: "$data"); print PREFIX.qq(----------------------------------); my @matches = `ypcat passwd | egrep -i '$data'`; print PREFIX.sprintf('%-8s - %s', (split(/:/))[0,4] ) foreach @matches; print PREFIX.'No matches found' unless @matches; print PREFIX; }); # print successful startup info print ">>> script loaded successfully"; 1;