----- Original Message -----
From: "James Woods" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 11, 2002 10:56 PM
Subject: Re: mysterious leading spaces (same foreach problem w/ more
details)


> I used the following code to write out all my hidden fields.  It didn't
get
> rid of the newline or caridge return characters at the end though.
>
> foreach my $item (@Draw){
> my $counter = 0;
> my $daValue = $item;
> chomp($daValue);
> print "<input type='hidden' name='drawHidden' value='$daValue'>\n";
> $counter++;
> }
>
> I accessed and created the array with this code:
>
> my @Draw = $cgi->param("drawHidden") || "";
>
> Any ideas why I can't get rid of the ending characters?  (besides the fact
> that I really have no idea what I'm doing? 8^)
>
> -James

I had the same problem in a script I was writing. You could use this to get
rid of your caridge returns.

foreach (@Draw) {
   chomp;
   s/\n//;
   print "<input type='hidden' name='drawHidden' value='$_'>\n";
}

Best Regards,
JOSHUA D. HAYDEN




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

Reply via email to