in reply to Re: Traversing through a directory structure
in thread Traversing through a directory structure

open FH, ">$WriteDirectory/$file" || die "Can't open $file: $!";

You either mean open( FH, ">..." ) || die "..." or open FH, ">..." or die "...". Your code will never execute the die statement because of the precedence problem.

freebie:~ 601> perl -MO=Deparse,-p open FH, ">$WriteDirectory/$file" || die "Can't open $file: $!"; open(FH, (">$WriteDirectory/$file" || die("Can't open $file: $!")));