I am writing a lost and found program that runs on a website and calls a PERL program to process the information into a data base. My problem is that when I click submit the PERL program doesn't run. Before I reloaded my computer it use to run, but I had the wrong code so it didn't do what I wanted. Now I think I have the right code but it won't run. If I double click the .pl file it runs and creates a .txt file with new lines in it. So I know PERL runs on my computer. As I said I think I am asking in the wrong forums but I don't know who or what to ask to get the help I need.

Here is the HTML form tag

 <form id="found" name="found" action="lost.pl" enctype="multipart/form-data" method="post">

Here is what I have so far for my PERL program code. I am not asking for help on the code for my program, as I am using this project to better learn PERL. I just need to know why it isn't running

#!/usr/bin/perl # Get Form Variables sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } } #end parse_form &parse_form; open (LOST, ">>lost.txt")or die "Cannot open lost.txt"; foreach $key (keys %FORM){ print LOST "$key $FORM{$key}+"; } print LOST "\n";

In reply to I think this is the wrong forums but I am not sure where to ask by pccenterllc

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.