Hi all,
I have tried the following, I know the logic behind it, but i am unable to put it rightly using the Perl format. I have tried the following
#!/usr/bin/perl
open FILE, "z.txt" or die $!;
while (<FILE>) {
print $_;
}
mkdir("1", 0777) || print $!;
mkdir("2", 0777) || print $!;
mkdir("3", 0777) || print $!;
mkdir("4", 0777) || print $!;
mkdir("5", 0777) || print $!;
mkdir("6", 0777) || print $!;
mkdir("7", 0777) || print $!;
mkdir("8", 0777) || print $!;
print " -Done";
exit;
I am have all the new directories with respective names. I want to copy the file z.txt from dir z to the new dir 1 with file name 1.txt , dir 2 with file name 2.txt and so on...
How could I use the copy function here.
Looking forward to your response.
Regards,
Ramesh
|