I tried this code and none of the print lines printed.
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:

#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 get the following output:
pre-for, pre-if
pre-if
29022 MW5 MI-100 3
post-if
pre-if
post-if
pre-if
26532 TTh4 ARC-205 3
post-if
pre-if
32330 MW6 VH-105 3
post-if
pre-if
20617 TTh7 PHY-LH 3
post-if
pre-if
30257 MTh2 ARC-204 3
post-if
post-for, post-if
post-all
which is correct.

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


In reply to Re: Re: Clarification and reiteration by deryni
in thread Keeping form information in CGI by deryni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.