Manshi Raghubanshi |
Question: How to find a files in a folder or sub folders?
Hi Bioinformaticians, I am new to bioinformatics and Perl. So, please execuse me if I disturb you all with newbie question. I am strugling to find a specific files (cattle_genome.fasta) from a folder and sub folders, and read it. I got some of the help form this website http://stackoverflow.com/questions/5651659/read-all-files-in-a-directory-in-perl in which they explain the extraction method using opendir function. It is suitable only when we have know directory name and depth of the folder. Can you please suggest me any other method to find the file recursively and read or write the specific fasta file. |
In such cases you can use File::Find module (http://perldoc.perl.org/File/Find.html. For beginner PerlMonk have very nice tutorial: http://www.perlmonks.org/?node_id=217166
# Warning code not tested