sort mount points by device_name/moint_point
Robert 'phaylon' Sedlacek [Fri, 11 May 2012 21:54:32 +0000 (21:54 +0000)]
lib/System/Introspector/MountPoints.pm

index f6ad0e4..325f961 100644 (file)
@@ -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;