($fsname, $fstype) = m/\S+ (\S+) (\S+)/;
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
open my $F, '<', '/proc/mounts' or die "open() error: $!\n";
my ($fsname, $fstype, %result);
while (<$F>)
{
($fsname, $fstype) = (split /\s+/)[1, 2];
#$fsname =~ s!/!\\/!g;
push @{$result{'data'}}, {'{#FSNAME}' => $fsname, '{#FSTYPE}' => $fstype};
}
close $F;
print JSON->new->pretty->encode (\%result);