in reply to Re: Is $formdata present?
in thread Is $formdata present?

Correct. CGi.pm will work for both POST and GET. For existence u couldd use something like..
use CGI qw(:standard); my %formdata = (); map { $formdata{$_} = param($_); } param; if(exists $formdata{'parametername'}) {do something;}

20050606 Janitored by Corion: Added formatting, put code in between <code>...</code> tags

Replies are listed 'Best First'.
Re^3: Is $formdata present?
by techcode (Hermit) on Jun 07, 2005 at 22:05 UTC
    While using CGI.pm is a good thing, you still made it more complicated than it should be, at least if you ask me ...
    use strict; use CGI; my $q = new CGI; my $form = $q->Vars(); if(exists $form->{parameter_name}){ #do whatever }
    Of course, you can also use Data::FormValidator. It's suggested if you need more complicated form validation.
Re^3: Is $formdata present?
by ruoso (Curate) on Jun 07, 2005 at 18:33 UTC
    And multipart-formdata encoding also, which you simply ignored.
Re^3: Is $formdata present?
by ecuguru (Monk) on Jun 07, 2005 at 17:45 UTC
    So what's the difference functionally between Defined and Exists? I thought Exists was used for subroutines and hashes? (clearly wrong)..
Re^3: Is $formdata present?
by Anonymous Monk on Jun 07, 2005 at 09:08 UTC
    Sorry.. I'm new. Will soon register myself and format my code. But my answer should work for you.
    Happy Coding