tachyon and fellow monks,

I took out ENCTYPE, and it still did not work. I know my file arrived ok, because I tested it with this code:
while(<$infile>){ push (@line, $_); }
When I print out @lines, it prints out the file I just uploaded. Also, this bit of error checking seems to work
my $infile = upload ('file') or die "File was not uploaded correctly\n +";
because if I don't enter a filename, I get the error "File was not uploaded correctly."

Next, I started looking at my hash. Now, here is the strange part. This code works fine:
for $i (keys %data) { push (@ips, $i); }
I can print out @ips in the results page, but then I tried this:
for $i (keys %data) { push (@ips, $i); for $j (keys %{$data{$i}{ports}}) { push (@names, $data{$i}{cname}); } }
and @names would not print out. I also tried this:
for $i (keys %data) { for $j (keys %{$data{$i}{ports}}) { push (@ips, $i); } }
and now @ips does not print out. I tried the last two bits of code in a non-CGI script, and they both print out as expected. Do you think I stumbled on a possible bug? I would appreciate any suggestion since this is driving me crazy.

Thanks,
Dru
Another satisfied monk.

In reply to Possible Bug? by dru145
in thread DBI script runs from command line, not from CGI by dru145

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.