in reply to (jeffa) Re: Very little CGI
in thread Very little CGI

Really thanks jeffa but the problem is that i'm a really newbie and i'm learning yet perl so it very hard for me learn also CGI module.
i'd like (now) to write CGI tag by tag as in my example :-( and then whem i will be more skilled write in CGI module style... So do you now where is the problem. Please.

-­--
os: Linux Mandrake 9.0
perl: obtained with OS

Replies are listed 'Best First'.
(jeffa) 3Re: Very little CGI
by jeffa (Bishop) on May 10, 2003 at 16:57 UTC
    Ok, so you don't have to use CGI.pm to write tags, but if you don't use CGI.pm to parse the incoming parameters, you are asking for trouble. At the very least, try something like this in your distro.pl file:
    use strict; use warnings; use CGI qw(:standard); print header,start_html; if (param('Spedisci')) { print pre( 'nome = ', param('nome'), "\n", 'conosciuto = ', param('conosciuto'), "\n", 'distro = ', param('distro'), "\n", ); } else { print "nothing submitted!"; } print end_html;
    Follow that link to Ovid's web course. Take the time to read it -- it's time well invested!

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Re: (jeffa) Re: Very little CGI
by valdez (Monsignor) on May 10, 2003 at 17:31 UTC

    Ciao nathanvit,
    please follow jeffa's advice and don't follow what is written in the online book linked from your home page :)

    Parsing form data is not easy as it may seem and the best solution is to use CGI.pm. Its usage isn't very different from the one explained in the online book for the Mcgi module. update: keep that book, but read section 14.4, where the author describes CGI.pm.

    The problem you encountered is that you are trying to read form data from $ENV{QUERY_STRING} that is filled only if you use method GET in your HTML form. When you use the POST method, data will arrive on standard input. So you have three options: change method from POST to GET or read form data from STDIN or use CGI.pm :)

    Ciao, Valerio