testMounts.pl untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl -w
2  
3 use strict;
4 use Linux::Mounts;
5  
6 my $mtd = Linux::Mounts->new();
7 my $list = $mtd->list_mounts();
8  
9 print "Number of mounted file systems : ", $mtd->num_mounts(), "\n\n";
10  
11 print "List of mounted file systems :\n";
12 for ( my $i = 0; $i < $mtd->num_mounts(); $i++ ) {
13 for ( my $j = 0; $j < $#{ $list }; $j++ ) {
14 printf ("%-15s", $list->[$i][$j]);
15 }
16 print "\n";
17 }
18  
19 # or simplier ...
20  
21 print "\nList of mounted file systems :\n";
22 $mtd->show_mount();
23