in reply to Re: Clarification and reiteration
in thread Keeping form information in CGI
open (ORGIDATA, ">../states/orig$$") or die "Couldn't open! $!"; print ORIGDATA "pre-for, pre-if"; print "pre-for, pre-if"; for (my $k = 0; $k < @classid; $k++) { print ORIGDATA "pre-if"; print "pre-if"; if ($classid[$k] != $classid[$k-1]) { print $classid[$k], " ", @{$class[$k]}, " ", $location[$k], " +", $credits[$k], "<br>\n"; } print ORIGDATA "post-if"; print "post-if"; } print ORIGDATA "post-for, post-if"; print "post-for, post-if"; #close ORGIDATA; print ORIGDATA "post-all"; print "post-all";
However when I use this code:
I get the following output:#open (ORGIDATA, ">../states/orig$$") or die "Couldn't open! $!"; #print ORIGDATA "pre-for, pre-if<br>"; print "pre-for, pre-if<br>"; for (my $k = 0; $k < @classid; $k++) { # print ORIGDATA "pre-if<br>"; print "pre-if<br>"; if ($classid[$k] != $classid[$k-1]) { print $classid[$k], " ", @{$class[$k]}, " ", $location[$k], " +", $credits[$k], "<br>\n"; } # print ORIGDATA "post-if<br>"; print "post-if<br>"; } #print ORIGDATA "post-for, post-if<br>"; print "post-for, post-if<br>"; #close ORGIDATA; #print ORIGDATA "post-all<br>"; print "post-all<br>";
I'm stumped by this, I'm going to start looking for other ways to do this but I'd really like an explanation for this behavior.
Thanks for any and all help.
    -Etan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Clarification and reiteration
by wardk (Deacon) on Jul 05, 2001 at 19:19 UTC |