From: Vincent Pit Date: Thu, 30 Jul 2009 09:52:15 +0000 (+0200) Subject: Just say no to indirect object notation X-Git-Url: http://git.vpit.fr/?p=perl%2Fscripts%2Fxchat.git;a=commitdiff_plain;h=b9c3e00cbf52ff5ddb0d79fd66a6877f6feb508d Just say no to indirect object notation --- diff --git a/Xchat/XPI.pm b/Xchat/XPI.pm index f71bb1e..032957d 100644 --- a/Xchat/XPI.pm +++ b/Xchat/XPI.pm @@ -155,10 +155,12 @@ sub PRINT { shift->print(@_) } sub PRINTF { shift->printf(@_) } -my $ph = new __PACKAGE__, name => 'Extended Xchat Perl Interface', - desc => 'Adds extended support for Perl scripts', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +my $ph = __PACKAGE__->new( + name => 'Extended Xchat Perl Interface', + desc => 'Adds extended support for Perl scripts', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/Xchat/XPI/Events.pm b/Xchat/XPI/Events.pm index b26f784..bb4eac1 100644 --- a/Xchat/XPI/Events.pm +++ b/Xchat/XPI/Events.pm @@ -54,11 +54,13 @@ our %EXPORT_TAGS = ( our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; -$ph = new Xchat::XPI name => 'Extended Xchat Perl Interface :: Events', - tag => 'XPI::Events', - desc => 'More events handlers', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Extended Xchat Perl Interface :: Events', + tag => 'XPI::Events', + desc => 'More events handlers', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/Xchat/XPI/Net.pm b/Xchat/XPI/Net.pm index 56cd68f..285e11a 100644 --- a/Xchat/XPI/Net.pm +++ b/Xchat/XPI/Net.pm @@ -117,11 +117,13 @@ our %EXPORT_TAGS = ('funcs' => [ qw/resolve whois/ ]); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; -$ph = new Xchat::XPI name => 'Extended Xchat Perl Interface :: Net', - tag => 'XPI::Net', - desc => 'Asynchronous network tools', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Extended Xchat Perl Interface :: Net', + tag => 'XPI::Net', + desc => 'Asynchronous network tools', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/Xchat/XPI/Utils.pm b/Xchat/XPI/Utils.pm index 1cb3ade..30f31c6 100644 --- a/Xchat/XPI/Utils.pm +++ b/Xchat/XPI/Utils.pm @@ -29,11 +29,13 @@ our %EXPORT_TAGS = ('funcs' => [ qw/dye_nick/ ]); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; -$ph = new Xchat::XPI name => 'Extended Xchat Perl Interface :: Utils', - tag => 'XPI::Utils', - desc => 'Utility functions', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Extended Xchat Perl Interface :: Utils', + tag => 'XPI::Utils', + desc => 'Utility functions', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/clones.pl b/clones.pl index a8b01fb..c735c88 100755 --- a/clones.pl +++ b/clones.pl @@ -256,12 +256,14 @@ hook_command 'CLSCAN', sub { help_text => 'Scan for clones in the current channel' }; -$ph = new Xchat::XPI name => 'Clones scanner', - tag => 'Clones', - desc => 'Automatic & on-demand clones scanner', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com', - unload => sub { undef %users }; +$ph = Xchat::XPI->new( + name => 'Clones scanner', + tag => 'Clones', + desc => 'Automatic & on-demand clones scanner', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', + unload => sub { undef %users }, +); 1; diff --git a/hl.pl b/hl.pl index f652643..fdaaf5c 100755 --- a/hl.pl +++ b/hl.pl @@ -84,12 +84,14 @@ filter 'Channel Action Hilight' => sub { } } => 'Channel Action'; -$ph = new Xchat::XPI name => 'Smart highlighting', - tag => 'HL', - desc => 'Highlight on private messages', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Smart highlighting', + tag => 'HL', + desc => 'Highlight on private messages', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/mpd.pl b/mpd.pl index 440fea7..ca73288 100755 --- a/mpd.pl +++ b/mpd.pl @@ -52,11 +52,13 @@ hook_command $_, sub { help_text => "$_, output which song is currently played by mpd" } for qw/MPD NP/; -$ph = new Xchat::XPI name => 'MPD Client', - tag => 'MPD', - desc => 'Music Player Daemon client', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'MPD Client', + tag => 'MPD', + desc => 'Music Player Daemon client', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/net.pl b/net.pl index eefa83c..bcb9002 100755 --- a/net.pl +++ b/net.pl @@ -132,11 +132,13 @@ hook_command 'TLD', sub { help_text => 'TLD , give the TLD text representation of the hosts' }; -$ph = new Xchat::XPI name => 'Networking tools', - tag => 'Net', - desc => 'DNS & Whois clients, TLD names', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Networking tools', + tag => 'Net', + desc => 'DNS & Whois clients, TLD names', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/opers.pl b/opers.pl index 2500f83..6beaf93 100755 --- a/opers.pl +++ b/opers.pl @@ -94,12 +94,14 @@ hook_command 'OPSCAN', sub { help_text => 'OPSCAN, scan for IRC operators in the current channel' }; -$ph = new Xchat::XPI name => 'Operators', - tag => 'Opers', - desc => 'IRC operators scanner', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com', - unload => sub { undef %opers; }; +$ph = Xchat::XPI->new( + name => 'Operators', + tag => 'Opers', + desc => 'IRC operators scanner', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', + unload => sub { undef %opers }, +); 1; diff --git a/services.pl b/services.pl index 10f4fd4..8fd3b90 100755 --- a/services.pl +++ b/services.pl @@ -94,11 +94,13 @@ hook_command "C$_", \&csmode, { 'the specified targets (or you if none) on the current channel via ChanServ' } for map { $_, "DE$_" } qw/VOICE HALFOP OP PROTECT/; -$ph = new Xchat::XPI name => 'IRC Services', - tag => 'Services', - desc => 'Various IRC services helpers', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'IRC Services', + tag => 'Services', + desc => 'Various IRC services helpers', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1; diff --git a/tools.pl b/tools.pl index bf6af18..b554d4a 100755 --- a/tools.pl +++ b/tools.pl @@ -140,11 +140,13 @@ hook_command 'HGREP', sub { help_text => 'HGREP , print users in the current context whose hostname matches text' }; -$ph = new Xchat::XPI name => 'Misc tools', - tag => 'Tools', - desc => 'Perl interpretor, URI escaper', - author => 'Vincent Pit (VPIT)', - email => 'perl@profvince.com', - url => 'http://www.profvince.com'; +$ph = Xchat::XPI->new( + name => 'Misc tools', + tag => 'Tools', + desc => 'Perl interpretor, URI escaper', + author => 'Vincent Pit (VPIT)', + email => 'perl@profvince.com', + url => 'http://www.profvince.com', +); 1;