From: Robert 'phaylon' Sedlacek Date: Fri, 11 May 2012 21:57:09 +0000 (+0000) Subject: sort by filesystem/mount_point X-Git-Tag: v0.001_001~68 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5dff4ce7ff7705d5fbc5e8848e673eb14123c62;p=scpubgit%2FSystem-Introspector.git sort by filesystem/mount_point --- diff --git a/lib/System/Introspector/DiskUsage.pm b/lib/System/Introspector/DiskUsage.pm index 467f976..b2d1d9e 100644 --- a/lib/System/Introspector/DiskUsage.pm +++ b/lib/System/Introspector/DiskUsage.pm @@ -24,7 +24,12 @@ sub gather { )} = split m{\s+}, $line; push @rows, \%row; } - return { disk_usage => \@rows }; + no warnings 'uninitialized'; + return { disk_usage => [ sort { + ($a->{filesystem} cmp $b->{filesystem}) + || + ($a->{mount_point} cmp $b->{mount_point}) + } @rows ] }; }; }