|
Hi...
I need to create a directory and then create a file(regular) within that newly created directory...
I am able to create the directory but i m not able to create a file inside that directory... the file gets created in the current directory... Pls help me out...
Any kind of help will be truly appreciated...
|
|
|
the computer always has some default directory to work in.
to change it just do:
chdir "c:\\somefolder\\":
|
|
|
You can try this.
open (my $fh, '>', "location/of/NewDir/MyNew.file") or die $!;
print $fh "File data.....";
close($fh);
or if the file exists on the computer and you want to copy it to the new directory, you can try this.
use File::Copy;
copy("file1","file2") or die "Copy failed: $!";
|
|
|
|
|
|
|
// |