Skip to content

Instantly share code, notes, and snippets.

@aduitsis
Created August 1, 2014 13:39
Show Gist options
  • Save aduitsis/127a55bf615507ae289d to your computer and use it in GitHub Desktop.
Save aduitsis/127a55bf615507ae289d to your computer and use it in GitHub Desktop.
#!/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