ng spaces
Date: Wed, 13 Mar 2002 14:13:38 -0500
James Woods wrote:
> So I guess my newest question is, what am I doing wrong to only print out
> the first record of @Draw?
It's hard to know for sure without seeing the code where you initialize
@Draw. I went back and looked at earlie
First off, thanks for helping me, I really appreciate it.
I'm printing out the @Draw using this code:
foreach my $item (@Draw){
my @foo = split(/\|/, $item);
my $rowColor;
if ($counter == 7){
$rowColor = "#c0c0c0";
}else{
$rowColor = "#ff";
}
print "\n";
print "\t$counter\n";
fliptop wrote:
according to a 'view source' on the above url, your hidden input params
do indeed have a new line on the end.
try this (instead of chomp):
foreach (@Draw) {
s/\s+$//g; # remove all whitespace at the end of a row
print "\n";
}
James wrote:
Putting that code in place of
d. Oh well.
Thanks all for your help so far! It's been educational
Original Message Follows
From: fliptop <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: James Woods <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: mysterious leading spaces (same foreach proble
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
Original Message Follows
From: fliptop <[EMAIL PROT
OK, I've got a form where I'm passing an array via a hidden form field. The
problem is that (after submission) I'm getting a leading space at the
beginning of each 'record' after the first. In other words, the first
'record' is being passed as it should be, but each other record is being
prepe
When first running the page, the table is populated with all the records
that it should be populated with. After hitting "End Phase", the table only
contains the first record. I'm passing the @Draw as a hidden form field.
I've got 4 test print statements that print out @Draw (so I can see the