You can also say:

use strict;             # Always use strict =)
use CGI;
use CGI::Carp qw(fatalsToBrowser);      # Great for debugging
my $q = new CGI;                # Create a new CGI object that will parse both POST and
GET methods

# Now to access those parameters use one of the following methods

# This requires Perl 5.06, but is very useful
my %PARAMS = $q->Vars;
# -- or -- #
# Now all the element names are in @PARAMS
my @PARAMS = $q->param;
# -- or -- #
# Accessing individual form elements based on
#       the name of the element.  Works well when
#       used in conjunction with an array of
#       element names
print qq[This is the value of "SomeFormElement" -
$q->param('SomeFormElement')];

As for the original question, the reason the transliteration operator was
being used to begin with is that when a URL is sent  to your script, it is
encoded and the "+" sign is used to encode a " " (space).  So, the form
element value "My Home Page" gets sent as "My+Home+Page".  Using the code
above, in any of its forms, is cleaner and more efficient.

Peace In Christ -
Ron Goral
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


> -----Original Message-----
> From: Shaun Fryer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 5:49 PM
> To: Perl Beginners
> Subject: Re: RegEx question
>
>
> > > I have been using the below subroutine for Parsing my data from forms.
>
> Up until recently I was using cgi-lib.pl's ReadParse routine to do the
> same thing. Since the one you are using is quite similar you can
> easily port existing scripts using the following in place of that
> subroutine.
>
> use CGI;
> CGI::ReadParse(*formdata);
>
> ===================
>  Shaun Fryer
> ===================
>  London Webmasters
>  http://LWEB.NET
>  PH:  519-858-9660
>  FX:  519-858-9024
> ===================
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to