That is kool, but I am using CGI.pm like we all should be :)

On Monday, February 18, 2002 at 2:01 PM, [EMAIL PROTECTED] (John M) wrote:

> David,
> 
> foreach $key (keys(%in))
>    { $in{$key} =~ s/^\s+//;  $in{$key} =~ s/\s+$//; }
> 
>     That's all you have to do.
> 
> -jdm
> 
> (%in is generated under cgi-lib.pl)

So back to my question do need to assign param() to hash?

Thx,

Dave


>From an earlier post:
This is great for 'Upper-casing' just the first letter of a string!

#!/usr/bin/perl -w

my $key ="today's Departure date";
$key =~ s/([\w'-]+)/\u$1/g;

print  $key;
--------




> 
> >From: David Gilden <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: removing white space revisited
> >Date: Mon, 18 Feb 2002 13:48:46 -0500
> >
> >Hi,
> >
> >My goal is to  clean up the fields submitted from a form and then be able 
> >to use them in other places.
> >
> >Does the following modify the value of param('name') -- if I have a form 
> >element named 'name' --
> >permanently (like when you have an array)
> >
> >
> >foreach my $key (param()){
> >
> >$val = param($key),
> >$value =~ s/^\s+//;
> >$value =~ s/\s+$//;
> >$key =~ s/\d$//;
> >
> >
> >print "$key: $val\n\n";
> >
> >     }
> >
> >
> >later in the script
> >
> >print param('email')  # will this have been cleaned regrex in the up the 
> >loop above?
> >
> >
> >Do I have to assign my 'cleaned' data to a hash?
> >
> >Thanks!
> >
> >Dave
> >
> >*====================================================*
> >*   Cora Connection Your West African Music Source   *
> >*   http://www.coraconnection.com/                   *
> >*   Resources, Recordings, Instruments & More!       *
> >*====================================================*
> >
> >--
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx

*====================================================*
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/                   *  
*   Resources, Recordings, Instruments & More!       *
*====================================================*

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

Reply via email to