Ok, bear with me. I have used the suggestion:

my $dssp_obj = new Bio::Structure::SecStr::DSSP::Res('-file'=>$ARGV[0] +);

Which works (and I'm ignoring several filehandle warnings). Now, I have written a shell script:

#!/bin/bash while read DSSPLine ; do echo $DSSPLine DSSP_Output.pl $DSSPLine.dssp done

QUESTION: In each interation, the output of DSSP_Output.pl is written to a CSV file. Is there a way such that (in perl) this output is written for all 30,000 iterations to one file only?

The very obvious answer is to use a DSSP array like you mentioned, I have tried that (in a way):

use strict; # 'use strict' requires that you use 'my' for all local va +riables, or explicitely qualify all globals. use warnings; use Bio::Structure::SecStr::DSSP::Res; my @dssp_objs =(); foreach my $file (@ARGV) { push @dssp_objs, Bio::Structure::SecStr::DSSP::Res->new('-file'=>$file +); } foreach my $dssp_obj(@dssp_objs) { #Get PDB ID and Compound representation for each file my $pdb_id = $dssp_obj->pdbID(); print "Analysis of PDB:: ". $pdb_id. "\n"; my $cmpd = $dssp_obj->pdbCompound(); print "Representing:: ". $cmpd. "\n"; etc... }

But when I do this, and run the commandline with a txt file of the DSSP filenames:

 DSSP_Output.pl DSSP_codes.txt

I get an exception!

Please let me know what you think...apologies for all the headache...

A <slowly deconfusing> InfoSeeker

In reply to Re^2: Confused when reading Input within Perl and Shell Scripts by Anonymous Monk
in thread Confused when reading Input within Perl and Shell Scripts by InfoSeeker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.