#!/usr/bin/perl use strict; use warnings; BEGIN { use File::Spec (); use lib File::Spec->catdir( Xchat::get_info('xchatdir'), 'lib' ); } { package N0i::XChat::Do; use base 'N0i::Xchat::Base'; sub version { '2004051501' } } my $o = N0i::XChat::Do->new; $o->register; $o->set_hooks( [ 'command', 'do', sub { local $_ = $_[1]->[1] || ''; foreach (split(/\s*(? join($/, '/do [; [; ...]]', ' - Executes each command, one after another' ) } ] ); $o->loaded; 1; __END__ =head1 NAME N0i::XChat::Do - execute multiple commands in IRCII style =head1 SYNOPSIS /do ping foo ; ping bar /do msg foo hi ; msg bar by =head1 DESCRIPTION Nifty perl script to enable serializing of multiple commands on the same line. Each command is separated by 'B<;>': /do ping foo ; ping bar Semicolons may be escaped with a backslash to loose their "separator" meaning. /do say foo \; bar ; say just another foo test It isn't necessary to prefix your serialized commands with I, but can be used if wanted :) =head1 CHANGELOG * Sun May 16 2004 Marius FERARU 2004051601 - rewrote it to use N0i::Xchat::Base ;-] * Fri Apr 23 2004 Marius FERARU - 2004042301 - first version =head1 AUTHOR I =head1 LICENSE Copyright (C) 2004 Marius FERARU (altblue@n0i.net). All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.