nested loops

2010-12-20 Thread Mark M Huntress
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

Re: nested loops

2010-12-20 Thread Uri Guttman
MMH == Mark M Huntress mar...@bgsu.edu writes: MMH I want to nest a for loop in a for loop in a while loop, and I MMH can't even get just the first nesting to work yet. Here is the MMH relevant part of my scripting. MMH open(XYZ,$ARGV[0]ready.xyz); don't use @ARGV stuff like that

Re: nested loops

2010-12-20 Thread Shawn H Corey
On 10-12-20 07:04 PM, Mark M Huntress wrote: open(XYZ,$ARGV[0]ready.xyz); The three argument open is preferred and always check your opens for errors. my $file = $ARGV[0]ready.xyz; open my $xyz_fh, '', $file or die could not open $file: $!\n; #while (XYZ) { #chomp($_); while(

Re: nested loops

2010-12-20 Thread Rob Dixon
On 21/12/2010 00:04, Mark M Huntress wrote: 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,

Re: nested loops

2010-12-20 Thread John W. Krahn
Mark M Huntress wrote: 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); Better as: open XYZ, '', $ARGV[0]ready.xyz or die Cannot open