in reply to creating an xml file from perl
my $t = 1; # loop thru array of directory while ($filename = readdir(HOMEDIR)) { #parse the . .. things from directory array and for jpgs only if($filename ne "." && $filename ne ".." && substr($filename,length( +$filename)-4,4) eq ".jpg") { #increment index my $nfile; # create and print the jpg xml item into xml file $nfile=substr($filename,0,length($filename)-4); print FIL "<pic$t id=\"$t\" name=\"/images/$filename\"></pic$t>\ +n"; } $t++; # loop }
|
|---|