gvinu4u has asked for the wisdom of the Perl Monks concerning the following question:
I am reading the file names and want to insert the file name and count into the xml, I'm unable to perform this, can any one please help me in this below piece of code
#! /usr/bin/perl use XML::Simple; use Data::Dumper; $dir = "C:/Guru/Apollo/Video/VC1/"; $count = 0; opendir(BIN, $dir) or die "Can't open $dir: $!"; my @files = glob("C:/Guru/Apollo/Video/VC1/*"); foreach(@files) { print "\n",$_,"\n"; $count++; my $xml = q~<TEST testId="$count"> <InputFile CopyFile="true" DeleteLocalFile="true">$_</ +InputFile> <PlaybackActions> <Start> <DumpTopology></DumpTopology> </Start> <MonitorPipeline> <Duration>-1</Duration> </MonitorPipeline> <Close> </Close> </PlaybackActions> </TEST>~; print $xml,$/; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Modidy XML contents
by roboticus (Chancellor) on Jun 16, 2012 at 20:55 UTC | |
Re: Modify XML contents
by kcott (Archbishop) on Jun 17, 2012 at 06:25 UTC |
Back to
Seekers of Perl Wisdom