1 #!/usr/bin/perl 2 3 use Irssi; 4 use Irssi::Irc; 5 6 sub cmd_myrev { 7 8 my ($data, $server, $witem) = @_; 9 10 if (!$server || !$server->{connected}) { 11 Irssi::print("Not connected to server"); 12 return; 13 } 14 15 $revdata=reverse $data; 16 $revdata=~tr/\(\)\[\]{}p/\)\(\]\[}{q/; 17 $witem->command("/say $revdata"); 18 19 return 1; 20 } 21 22 Irssi::command_bind('rev', 'cmd_myrev');