develooper Front page | perl.beginners | Postings from January 2002

Re: What's wrong with this?

Thread Previous | Thread Next
From:
Jeff 'japhy' Pinyan
Date:
January 24, 2002 14:16
Subject:
Re: What's wrong with this?
Message ID:
Pine.GSO.4.21.0201241713350.9276-100000@crusoe.crusoe.net
On Jan 24, Eduardo Cancino said:

>Japhy, may i call u that way?, in this part...

Yes, the name "japhy" is fine -- I prefer its usage as my internet
persona, or whatever you'd like to call it.  It's easier to remember than
my real name, at any rate.

># inicia variables.
>> >$to = "info\@domain.mx";
>> >$from = "info\@domain.mx";
>> >$subject = "Comentarios Sitio Web";
>> >
>> ># manda el mail.
>> >open (MAIL,"|mail $to");
>> >print MAIL <<"END_top";
>> >
>> >"To: $to
>> >Reply-To: $to:
>> >Subject: $subject"
>> >
>> >END_top
>>
>> That's not working, I can promise you that.
>
>...the mail is being received.

For the wrong reason.  Does it have a Reply-To field?  I doubt it -- not
in the headers, at least.  And does it have a Subject field?  I doubt it
-- not in the headers, at least.

>With CGI.pm can I do this a lot easier???

With CGI.pm, you can read the form data SIMPLY, with ONE function:

  use CGI 'param';

Now, to get what the user entered for "age", you'd do:

  $foo = param 'age';

If you want to loop over all the form fields, you'd do:

  for $field (param()) {
    print "$field => ", param($field), "<br>\n";
  }

>How could I use de CGI.pm, there is a tutorial or something I can read about
>it???

CGI.pm comes with its own documentation.

  perldoc CGI

CGI.pm also comes WITH Perl.  If you have Perl, you have it.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About