]> git.vpit.fr Git - perl/scripts/xchat.git/blobdiff - clones.pl
Tweak host()
[perl/scripts/xchat.git] / clones.pl
index a8b01fb24b868f6c3f29bd9502c0ea5d69bfd5fd..12150e80dda752f97de46a4cf8158e5aa14a25e8 100755 (executable)
--- 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;