I want to nest a for loop in a for loop in a while loop, and I can't even get
just the first nesting to work yet. Here is the relevant part of my scripting.
open(XYZ,"$ARGV[0]ready.xyz");
#while (<XYZ>) {
#chomp($_);
for ($z = 0, $z <= $#sortedstart, $z++) {
for ($i = $sortedstart[$z], $i <= $sortedend[$z], $i++) {
if ($_ =~ /^\s+$i\s+(\D).*\s+(.+\.\d+\s+.+\.\d+\s+.+\.\d+)\s+/) {
$count++;
print CON " $count $count $1 0 $2\n";
}
print "\nz is $z\n";
print "\ni is $i\n";
}
}
I am expecting it to cycle through several $i values and also $z values. When
it prints the values, it only gives $z=1.
Does anyone see why this isn't working?
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/