Hello all, I'm starting to learn perl to convert files between different bioinformatics programs. I'm aware of bioperl but want to learn some basic perl before using those modules.
1) The script is in the same directory as the input folder, so open should be able to find it. 2) The open input folder part works because I get a I get a list of the files. 3) The whole program worked on a single file, but died when I tried to convert it to handle a whole directory as input. 4) I'm developing on a Windows machine, so I think setting file permissions are unnecessary, right? Here's the code snippet: use warnings; use strict; my @files = (); my $folder = 'input'; # Open the input folder unless (opendir(FOLDER, $folder)) { print "Cannot open folder $folder!\n\n"; exit; } #read the contents of the folder (files and subfolders) @files = readdir(FOLDER); #Close the folder print "\n\n Here are the files in the folder\n"; #print out the filenames, one per line print join( "\n", @files), "\n"; closedir(FOLDER); foreach my $seqfilename (@files){ [EMAIL PROTECTED] = @_; $seqfilename = ''; open (TXTFILE,"<$seqfilename") or die $!; close TXTFILE; my @seqelements = <TXTFILE>; ...........goes on from here I know the conversion routine works, because it worked when I specified a single file. Thanks for your help in advance, Ganesh -- Ganesh Shankar [EMAIL PROTECTED] -- http://www.fastmail.fm - A fast, anti-spam email service. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]