Make the script a little more general purpose usable by removing a hardcoded filename.
This commit is contained in:
parent
6c165c30f2
commit
c6feba04c9
1 changed files with 11 additions and 3 deletions
|
@ -1,17 +1,25 @@
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
use strict;
|
#use strict;
|
||||||
use warnings;
|
#use warnings;
|
||||||
|
|
||||||
# DEBUG
|
# DEBUG
|
||||||
# use Data::Dumper;
|
# use Data::Dumper;
|
||||||
# print Dumper($data) . "\n";
|
# print Dumper($data) . "\n";
|
||||||
# END
|
# END
|
||||||
|
|
||||||
|
if (scalar (@ARGV) == 1) {
|
||||||
|
@files = glob("$ARGV[0]");
|
||||||
|
print "Processing : ", @files, "\n";
|
||||||
|
} else {
|
||||||
|
die "Usage : conf2xml.pl <inputfile> [ > outputfile ]\n";
|
||||||
|
}
|
||||||
|
$file = shift(@files);
|
||||||
|
|
||||||
use Switch;
|
use Switch;
|
||||||
use XML::LibXML;
|
use XML::LibXML;
|
||||||
my $parser = XML::LibXML->new();
|
my $parser = XML::LibXML->new();
|
||||||
my $doc = $parser->load_xml(location => './CEB.xml');
|
my $doc = $parser->load_xml(location => $file);
|
||||||
my $data;
|
my $data;
|
||||||
|
|
||||||
# reformatting days
|
# reformatting days
|
||||||
|
|
Loading…
Reference in a new issue