X-Chat Perl Reflex Script

Hi, this plugin allow your X-Chat client to reflex any DCC SEND like mIRC does. We have created this plugin, due to the high number of people that has requested us a plugin to reflex from X-Chat.
Also, my friend Xardax has the idea to make a plugin for KvIRC too, so be patient :)
If yuo have any doubts you can contact us on IRC: irc.darksin.ch :: #linux

#!/usr/bin/perl

use warnings;
use strict;
use Xchat;

my $reflex_nick="";

Xchat::register("Reflexer","1.0","Reflexer Perl Script","");
Xchat::print ("^BScript loaded.");
Xchat::print ("^BPlugin for X-Chat by blackms & Xardax :: #linux \@irc.darksin.ch");
Xchat::print ("^BUsage: /reflex REFLEX_NICK\n^BTo turn reflexing off: /rfx_off");

Xchat::hook_command('reflex',"reflex");
Xchat::hook_command('rfx_off',sub {
                                Xchat::print ("^BReflexing turned off.");
                                $reflex_nick="";
                              }
                   );
Xchat::hook_server("PRIVMSG","ctcpreflex");

sub reflex {
        $reflex_nick = defined $_[0][1] ? $_[0][1] : "";
        Xchat::print("^BReflexing all DCC SEND to: $reflex_nick");
        return Xchat::EAT_ALL;
}

sub ctcpreflex {
        return Xchat::EAT_NONE if ($reflex_nick eq "");
        my $data=$_[1][0];
        if ($data =~ m{\001DCC\sSEND\s(.*)\s(\d+)\s(\d+)\s(\d+)\001}) {
                my ($file,$intip,$port,$length) = ($1,$2,$3,$4);
                Xchat::print ("^BReflexing: $file to $reflex_nick on port: $port, length: $length");
                Xchat::command ("PRIVMSG $reflex_nick :\001DCC SEND $file $intip $port $length\001\n\r");
                return Xchat::EAT_ALL;
        }
        return Xchat::EAT_NONE;
}

Bye :)