in reply to Directory Help

Just give it a new path:

my $newpath = '/place/to/put/'; open (DAT,"> ${newpath}${TextFile}") or die $!; print DAT "$text\n" or die $!; close(DAT) or die $!;
The braces around the variable names in open are to make sure of the variable name boundaries, and all the 'or die's are to make sure the program quits and you get diagnostics if the system operations fail.

After Compline,
Zaxo