From c6feba04c9a7396b7a9e1572a9c60328b24449e3 Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Mon, 3 Jan 2011 13:58:12 +0100 Subject: [PATCH] Make the script a little more general purpose usable by removing a hardcoded filename. --- scripts/perl/traffic/xml2conf.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/perl/traffic/xml2conf.pl b/scripts/perl/traffic/xml2conf.pl index e66da0841..f4f462070 100755 --- a/scripts/perl/traffic/xml2conf.pl +++ b/scripts/perl/traffic/xml2conf.pl @@ -1,17 +1,25 @@ #!/usr/bin/perl -w -use strict; -use warnings; +#use strict; +#use warnings; # DEBUG # use Data::Dumper; # print Dumper($data) . "\n"; # END +if (scalar (@ARGV) == 1) { + @files = glob("$ARGV[0]"); + print "Processing : ", @files, "\n"; +} else { + die "Usage : conf2xml.pl [ > outputfile ]\n"; +} +$file = shift(@files); + use Switch; use XML::LibXML; my $parser = XML::LibXML->new(); -my $doc = $parser->load_xml(location => './CEB.xml'); +my $doc = $parser->load_xml(location => $file); my $data; # reformatting days