From: Robert 'phaylon' Sedlacek Date: Fri, 11 May 2012 21:54:32 +0000 (+0000) Subject: sort mount points by device_name/moint_point X-Git-Tag: v0.001_001~69 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b167797dccd0cd2a3ceab543618334c2c0234ff6;p=scpubgit%2FSystem-Introspector.git sort mount points by device_name/moint_point --- diff --git a/lib/System/Introspector/MountPoints.pm b/lib/System/Introspector/MountPoints.pm index f6ad0e4..325f961 100644 --- a/lib/System/Introspector/MountPoints.pm +++ b/lib/System/Introspector/MountPoints.pm @@ -50,7 +50,12 @@ sub _parse_tab_fh { }, }; } - return \@mounts; + no warnings 'uninitialized'; + return [ sort { + ($a->{device_name} cmp $b->{device_name}) + || + ($a->{mount_point} cmp $b->{mount_point}) + } @mounts ]; } 1;