#!/usr/bin/perl

use Irssi;
use Irssi::Irc;

sub cmd_myrev {

 my ($data, $server, $witem) = @_;

  if (!$server || !$server->{connected}) {
    Irssi::print("Not connected to server");
    return;
  }

  $revdata=reverse $data;
  $revdata=~tr/\(\)\[\]{}p/\)\(\]\[}{q/;
  $witem->command("/say $revdata");

  return 1;
}

Irssi::command_bind('rev', 'cmd_myrev');
