Created
August 1, 2014 13:39
-
-
Save aduitsis/127a55bf615507ae289d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use v5.14; | |
use strict; | |
use warnings; | |
use JSON::XS; | |
use File::Slurp; | |
use Data::Dump; | |
use Data::Printer; | |
my @lines = read_file( shift // '/root/ovs/etc/openvswitch/conf.db' ) ; | |
while( @lines ) { | |
say shift(@lines); | |
p decode_json shift(@lines); | |
next; | |
my ($key,$value) = ( shift(@lines),shift(@lines) ); | |
say $key; | |
eval { | |
p decode_json $value | |
}; | |
if($@) { | |
say 'Cannot parse: '.$value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment