]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Fix conditional sub that isn't actually conditional
authorPablo Martín Báez Echevarría <redacted>
Sun, 21 Dec 2014 21:39:13 +0000 (19:39 -0200)
committerPablo Martín Báez Echevarría <redacted>
Sun, 21 Dec 2014 22:04:09 +0000 (20:04 -0200)
_data/scripts.yaml
scripts/clones_scanner.pl

index b17615a35407939d032f9aaf1dbf10b0e590dc8b..8ba79a8747d9718c44cd950308e6990dee8cd317 100644 (file)
   license: "Public domain"
   name: "clones_scannner"
   url: "http://reirssi.wordpress.com"
-  version: "1.5"
+  version: "1.6"
 
 - authors: "Gabor Nyeki"
   contact: "bigmac@vim.hu"
index 1f31fbbbb1c56f6c56cbf5a0680ed47a308b12a1..bf308a0138141d54224b33eb757e8200e8476cdf 100644 (file)
@@ -7,9 +7,11 @@ use warnings;
 use Irssi;
 use vars qw($VERSION %IRSSI);
 
-# Thanks to noi_esportista!#Girona@chathispano for his suggestions about how this script should work.
+# Thanks to:
+# -noi_esportista!#Girona@chathispano for his suggestions about how this script should work.
+# -dg!#irssi@freenode (David Leadbeater) for the several code style issues that he pointed out and that helped me to improve my Perl.
 
-$VERSION = '1.5';
+$VERSION = '1.6';
 %IRSSI = (
        authors     => 'Pablo Martín Báez Echevarría',
        contact     => 'pab_24n@outlook.com',
@@ -266,15 +268,12 @@ Irssi::theme_register([
 
 if ($have_devel_size) {
   
-  sub clones_scanner_size_cmd {
-    #use Data::Dumper;
-    #print Dumper(\%hosts_hash);
+  Irssi::command_bind('clones_scanner_size' , sub {
     my $bytes = Devel::Size::total_size(\%hosts_hash);
     print "Number of entries in \%hosts_hash: ", $total_entries;
-    print "Size in bytes: ".$bytes;
+    print "Size in bytes: "$bytes;
     print int($bytes/1024/1024)."MB ".int($bytes/1024%1024)."kB ".int($bytes%1024)."B of data";
-  }
-  Irssi::command_bind('clones_scanner_size' , \&clones_scanner_size_cmd);
+  });
 
 } else {
 
git clone https://git.99rst.org/PROJECT