On Wed, 18 Sep 2002, Simon Tomlinson wrote:

> 
> 
> Apologies, that was bad typing in my email.  I rearrange the algorithm to make it 
>easier to read.  Here is my exact source and the exact output.  Even without the 
>space there, it still doesn't work!!
> 
> Any ideas?
> Simon.
> 
> 
> sub getEvents
> {
>   my @rows = &getDBTable($tbl_events);
>   my @colDefs = ("");
>   @colDefs = split(",",substr($rows[0], index($rows[0],":")+1));
>   my $rowCount = -1;
>   my @rowCols;
> 
>   foreach $row (@rows)
>   {
>       if ($rowCount > -1)
>       {
>         my %tempCols = &getCols($row, @colDefs);
> 
>         foreach $key (keys %tempCols)
>         {
>             print "WORKS: $key $tempCols{$key}<br>\n";
>         }
>         $rowCols[$rowCount] = %tempCols;

You are assigning a hash to a scalar here, you will have to assign the 
reference of the hash instead.
$rowCols[$rowCount] = \%tempCols;

>       }
> 
>        my %event = $rowCols[$rowCount];

And change this too
my %event = %{$rowCols[$rowCount]};

or 

remove the my line and change the foreach as
foreach $key (keys %{rowCols[$rowCount]})

>        foreach $key (keys %event)
>        {
>            print "DOESN'T WORK: $key $event{$key}<br>\n";
>        }
> 
>      $rowCount = $rowCount + 1;
>   }
>   return @rowCols;
> }


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

Reply via email to