in reply to Re^2: Confused when reading Input within Perl and Shell Scripts
in thread Confused when reading Input within Perl and Shell Scripts
The approach I gave would have worked if you had all of the list of filenames on the command line. If you want to take the list of filenames from a file, then we need to modify the input loop somewhat:
my @dssp_objs =(); #reads the files from the command line one line at a time. while(<>) { chomp; # remove the newline. push @dssp_objs, Bio::Structure::SecStr::DSSP::Res->new('-file'=>$_); }
This code would read a line at a time out of DSSP_codes.txt (using your example).
I changed to the while(<>) loop just to be consistent with the way most people do this kind of loop. Since it automatically loads the $_ variable (and the loop is pretty short), I removed the $file variable. Otherwise, this is a drop-in replacement for the previous loop that should meet your needs.
|
|---|