diff options
| author | Pablo Martín Báez Echevarría | 2014-12-21 19:39:13 -0200 |
|---|---|---|
| committer | Pablo Martín Báez Echevarría | 2014-12-21 20:04:09 -0200 |
| commit | 2ce65b858faa73ed871b1df18ef06e3282c5c032 (patch) | |
| tree | 69d17770e7e00a2bd87d5dbb5b4792edb049bc79 /scripts | |
| parent | 1f1261d5cab4ad77b87ebb58f60973a00753ec89 (diff) | |
| download | scripts.irssi.org-2ce65b858faa73ed871b1df18ef06e3282c5c032.tar.bz2 | |
Fix conditional sub that isn't actually conditional
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/clones_scanner.pl | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/clones_scanner.pl b/scripts/clones_scanner.pl index 1f31fbb..bf308a0 100644 --- a/scripts/clones_scanner.pl +++ b/scripts/clones_scanner.pl @@ -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 { |
