Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: Hello im new to programming i need helpby jethro (Monsignor) |
on Feb 10, 2013 at 02:11 UTC ( [id://1018011]=note: print w/replies, xml ) | Need Help?? |
Well, this means that for example the variable $xC1 didn't get set to any value when you use it in line 80. Now lets look at the lines where you want to set the variable. It is in a part that is executed only when two if-clauses are true. The warnings indicate that all variables that depend on the outer if-clause "if ($one[0]=~m/^HETATM/)" have the same problem. So this if-clause probably is never true for at least the first two executions of the outermost loop i.e. for the first two files (and it seems from your test output that there is a third file where the if-clause is successfully run through). Because of that the variables are empty and you get the warnings. So you have to change your script so that when the information you seek is not in the file the rest of the loop isn't executed anymore. For example:
I'm using the first three bits in the variable $allfound to tell me if all if-clauses where run through at least once for this file.
In Section
Seekers of Perl Wisdom
|
|