From c3ba72a8a3e0bcaae29e6430279381811299bf37 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 19 Aug 2012 23:14:52 +0200 Subject: pretty-print read size 0 as 'infinite' --- lib/App/Hashl.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/App/Hashl.pm b/lib/App/Hashl.pm index f17f771..f0a93ce 100644 --- a/lib/App/Hashl.pm +++ b/lib/App/Hashl.pm @@ -40,6 +40,10 @@ sub si_size { my ( $self, $bytes ) = @_; my @post = ( q{ }, qw(k M G T) ); + if ($bytes == 0) { + return 'infinite'; + } + while ( $bytes >= 1024 ) { $bytes /= 1024; shift @post; -- cgit v1.2.3