>>>>> "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 before you check that you have args.

always check for success with open calls

also use lexical handles for i/o.

all of these are common points you can google for more info


  MMH> #while (<XYZ>) {
  MMH>   #chomp($_);
  MMH>   for ($z = 0, $z <= $#sortedstart, $z++) {

where did you get that syntax from? it isn't any normal perl loop. in
fact it is a foreach loop over 3 values (afaict) and nothing close to
what you envisioned it to be.

read perldoc perlsyn for the two ways to write for loops - a c style and
a perl foreach style. yours is a strange conjunction of the two styles
and makes no sense at all.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to