On Wed, Jul 8, 2015 at 10:51 AM, Nagy Tamas (TVI-GmbH) <
[email protected]> wrote:
> How can it be? I call the subroutine in the middle of a tag. How can be
> the document closed?
>
Well, I don't get that (could it be that call to
Travers($dir,$writer);
before the sub def?) but to get your code to work I had to keep the dir
involved
sub Traverse
{
my $dir = shift;
opendir(DIR, $dir) or die "Cannot open directory $dir:
$!\n";
my @files = readdir(DIR);
closedir(DIR);
foreach my $file (@files) {
# generate XML here
if(-d "$dir/$file" and ($file !~ /^\.\.?$/)
) {
# make dir branch
Traverse("$dir/$file");
}
--
a
Andy Bach,
[email protected]
608 658-1890 cell
608 261-5738 wk