shailesh143
06-23-2009, 12:34 AM
HI all,
#!/usr/bin/perl
foreach $i (1..5)
{
print " Creating directories under C: drive \n";
mkdir("C:/Er");
mkdir("C:/Op");
mkdir("C:/Ip");
mkdir("C:/Ima");
mkdir("C:/Imp");
# Till above lines it works
for($i=0;$i<=100;$i++)
{
mkdir('C:/Ip/Batch$i');
}
}
With this Script i am able to create folders, but in For loop, i want to create 100 folders with name "Batch1, Batch2.....Batch100" Its creating only one folder with name "Batch$i".
How do i do it?
Kindly help me.
and correct the code.
Regards,
Shail's
#!/usr/bin/perl
foreach $i (1..5)
{
print " Creating directories under C: drive \n";
mkdir("C:/Er");
mkdir("C:/Op");
mkdir("C:/Ip");
mkdir("C:/Ima");
mkdir("C:/Imp");
# Till above lines it works
for($i=0;$i<=100;$i++)
{
mkdir('C:/Ip/Batch$i');
}
}
With this Script i am able to create folders, but in For loop, i want to create 100 folders with name "Batch1, Batch2.....Batch100" Its creating only one folder with name "Batch$i".
How do i do it?
Kindly help me.
and correct the code.
Regards,
Shail's