The first is more efficient, the second is less typing. ....And actually the second one is incorrect, it should be this:
Rob -----Original Message----- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: removing white space Is this correct, I want to remove leading and trailing white space, Thanks Dave -------------- foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } better?? foreach $item (param()) { my $value = param($item); $value =~ s/^\s+(.*)\s+$/$1/; } ------------- #!/usr/bin/perl use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use POSIX 'strftime'; $mailprog = '/usr/lib/sendmail'; # Retrieve Date $date = strftime('%A, %B %1d, %Y %I:%M %p',localtime) ,"\n"; # my %in = {}; # remove any extra spaces at the front or back foreach $item (param()) { my $value = param($item); $value =~ s/^\s+//; $value =~ s/\s+$//; } $email = param('email'); $realname = param('name'); *====================================================* * 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]