I have researched this question out on the web as well as I know how in several places (perlmonks, Orielly, etc.) but have found no answers.

Using ActivePerl with Apache web server on Windows ME operating system (home computer). I know, thats not the greatest situation but till I get linux thats what I am using. Am trying to write data out to a file that is input from a web page form thru GET and is passed into a %hash variable (%form_data) for parsing. Am able to print qq($name - $value <br><br>); and view the hash pairs on the web page as shown below. However, when I try to write them out to a file using:     print GUESTBOOK $form_data{'name'}  # for example (see below) nothing is actually written although the web page executes as shown below. Does anyone know if this is a problem with the Windows version of Perl or Apache or maybe I am doing something wrong AGAIN.

#----- Hash parse section shown below ---------------------- # Finally, we'll load the variables into an associative array # so we can use it when we need it. my %form_data; if($form_data{$name}) { $form_data{$name} .= "\t$value"; } else { $form_data{$name} = $value; } print qq($name = $value <br><br>); }
#------------------------------------------------- This is the web page output from above print qq statement plus other c +ode #-----------------------------------------------------------
name = me email = me@you.com city = boogerville location = XYZ web_url = www.me.you web_title = STUFFit comments = These are comments. Hi There. What'cha doin'? Your GuestBook Entry has been Submitted! Your guestbook entry has been successfully added to the guestbook. You + may need to click reload to view your guestbook entry.
#------------------------------------------------- # attempt to write data out to a file here. # doesn't work. nothing writes out. if($form_data{'email'}) { # if there's an email address, let's add it as a link print GUESTBOOK "<DD><I><B><A HREF=\"mailto:$form_data{'email +'}\"> $form_data{'name'}</A></B> - $form_data{'city'}, $form_data{'location'}</I>\n"; } else { # otherwise, just add their name print GUESTBOOK "<I><B>From:</B> $form_data{'name'}</I><BR>\n"; }

Edit kudra, 2002-08-31 Removed code tags around plaintext

# the above code does not put out any data to the file but it does run. Thanks, ljdennis@att.net

In reply to Hash Parsing Problem by Anonymous Monk

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.