X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=clones.pl;h=12150e80dda752f97de46a4cf8158e5aa14a25e8;hb=125e52ff2903768a9859f17b9e4b2dce157b4ea0;hp=a8b01fb24b868f6c3f29bd9502c0ea5d69bfd5fd;hpb=263b6777b90548951a13bd56419fa911b010eb9b;p=perl%2Fscripts%2Fxchat.git diff --git a/clones.pl b/clones.pl index a8b01fb..12150e8 100755 --- a/clones.pl +++ b/clones.pl @@ -45,8 +45,7 @@ sub clone_list_str { sub host { my $userhost = lc $_[0]; - my ($host) = $userhost =~ /@([^@]+)$/; - return $host || $userhost; + return $userhost =~ /@([^@]+)$/ ? $1 : $userhost; } sub add { @@ -256,12 +255,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;