in reply to What is wrong with my File open?

See if this tells you anything:
chdir "/" or die "Can't cd to /: $!"; my @dir = split /\//, $outputFileName; pop @dir; shift @dir; chdir $_ or die "Can't cd to [$_]: $!" for @dir;