Hi All,
Can any one tell me how to restrict my search to one level. If i have a folder
master which contains 2 folders "pata" and "thread".
the folder pata contains 2 folders "telus" and "high".
the folder thread contains 1 folder "give" and "give" folder contains a file long.txt.
If my perl script is as below
-----------------------------------------------------
use File::Find;
# Print out all directories below current one.
chdir('D:\required');
find sub { print "$File::Find::name\n" if -d }, ".";
-----------------------------------------------------
i get the output as
./pata
./thread
./pata/telus
./pata/high
./thread/give
but i want my output to only display ./pata and ./thread
that is my search should end after searching the current folder it should not search the subfolder.
Any help is highly appreciated.
Thanks in advance.
Can any one tell me how to restrict my search to one level. If i have a folder
master which contains 2 folders "pata" and "thread".
the folder pata contains 2 folders "telus" and "high".
the folder thread contains 1 folder "give" and "give" folder contains a file long.txt.
If my perl script is as below
-----------------------------------------------------
use File::Find;
# Print out all directories below current one.
chdir('D:\required');
find sub { print "$File::Find::name\n" if -d }, ".";
-----------------------------------------------------
i get the output as
./pata
./thread
./pata/telus
./pata/high
./thread/give
but i want my output to only display ./pata and ./thread
that is my search should end after searching the current folder it should not search the subfolder.
Any help is highly appreciated.
Thanks in advance.