in reply to Not getting form data from stdin

OK guys, thanks for the pointers, seems I haven't understood list v scalar context as well as I thought - guess I'll have to re-read that bit in "Learning Perl". Also may have confused myself unnecessarily by using the same variable name in different places. Will look up the CGI module - I'm very unfamiliar with what modules are available. I was also planning on using Mail::Sendmail for the next part of the script.

Replies are listed 'Best First'.
Re^2: Not getting form data from stdin (nms-cgi)
by Anonymous Monk on Nov 06, 2014 at 08:42 UTC
    Yeah, stop right there, don't write any more code, read TFMail, study it, study the functions it uses ... if you're going to start in the past at least start with something that works :) and these FAQs (a copy of a copy paste)

      Right - so far I've got:

      sub parse { my $q = new CGI; print $q->header; print '<html><head>'; print '<title>Test</title>'; print '</head><body>'; print "These are the parameters I received:<p>"; my( $name, $value ); foreach $name ( $q->param ) { print "$name:\n"; foreach $value ( $q->param( $name ) ) { print " $value\n"; } } print '</p></body></html>'; }

      Unfortunately the output is:

      These are the parameters I received: POSTDATA:

      So really not much progress. However since it seems I've been going about this all wrong maybe just best to leave that and start over from the beginning with TFMail. Feeling somewhat discouraged.

        Add name to inputs in html form
        <input type="text" id="name" name="name" /> -----------
        poj