My problem lies in this code. It seems to work fine on the command prompt, but once on my server, it doesn't seem to work. It gives no output when you search.

#!/usr/bin/perl -w use strict; use CGI qw(:standard); print header(), start_html("Street Print CD Catalog"), h1("StreetPrint CD Catalog"); ## if the script has been run if (param()) { ##get the color chomp(my $color = param("color")); ## get the pattern chomp(my $pattern = param("pattern")); ## show the 2 received variables print p($color, br(), $pattern); my (%dbcolor, %dbpattern, %dbcd, @name); ## open my DB file open (DBFILE, "form.db") or die "$!"; my $i = "0"; while ($name[$i] = <DBFILE>) { ## put the first line of 4 in name $dbcolor{$name[$i]} = <DBFILE>; ## put the second line of 4 in $ +dbcolor, referenced with the name ## of the picture $dbpattern{$name[$i]}= <DBFILE>;## put the third line of 4 in $d +bpattern, referenced with the name ## of the picture $dbcd{$name[$i]}= <DBFILE>; ## get the cd number of the picture $i++; } close (DBFILE); foreach (@name) { ## if either color or pattern match on the file, show all results that + do if (($dbcolor{$_} eq $color) or ($dbpattern{$_} eq $pattern)) { print p($_, br(), $dbcolor{$_}, br(), $dbpattern{$_}, br(), $d +bcd{$_}, br()); } } } else { print start_form();## create the form print p("What Color do you want? ", popup_menu("color", ["Any", 'Brick +', 'Terracotta','Burnt Sienna','Hunter Green','Safety Blue','White', +'Bedrock','Slate','Sierra'])); print p("What Pattern do you want? ", popup_menu("pattern", ["Any", 'O +ffset Brick','Herringbone','Herringbone Diagonal','Ashlar Slate','Bri +tish Cobble','Frisco Cobble','Random Stone','Eurofan'])); print p(submit("Find"), reset("Reset")); print end_form; } print end_html;

Now the file that is being run here and the DB file is being run here.



----------------------------
Wiz, The VooDoo Doll
Head Master of 12:30 Productions
----------------------------


In reply to CGI, Newlines, and If Statements by wiz

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.