From 813cb59ea518d35c51521f6c98e7dfa89dca6cd5 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 8 Jul 2013 16:56:54 +0200 Subject: [PATCH] ulog_parser.pl: Use YAML::Syck and quote all strings. --- ulog_parser.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ulog_parser.pl b/ulog_parser.pl index e4c04941..bae015d8 100755 --- a/ulog_parser.pl +++ b/ulog_parser.pl @@ -3,11 +3,13 @@ use 5.014; use strict; use warnings; use JSON; -use YAML; +use YAML::Syck; use File::Spec; use Cwd 'abs_path'; use Data::Dumper; +local $YAML::Syck::SingleQuote = 1 ; + my $filename = "/var/log/ngcp/kamailio-proxy.log"; my $output_dir = "log"; my $path; @@ -31,7 +33,7 @@ sub save_data { if (!$data->{'sip_out'}) { print "no sip_out\n"; } $path = File::Spec->catfile( $output_dir, (sprintf "%04i", $data->{'msgid'}).".yml"); - YAML::DumpFile($path, $data); + YAML::Syck::DumpFile($path, $data); #print "$data->{'msgid'} saved\n"; } $data = {