On Wed, Jul 8, 2015 at 10:51 AM, Nagy Tamas (TVI-GmbH) < tamas.n...@tvi-gmbh.de> 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, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk