Skip to main content.
home | support | download

Back to List Archive

SWISH::API and my lame perl skillz....

From: Brad Miele <bmiele(at)not-real.ipnstock.com>
Date: Mon Jan 24 2005 - 21:27:38 GMT
Hi,

I know that this is maybe for a perl list and not swish-e specific, but,
well, i really have no excuse actually...

Generally, when i am using SWISH::API in my web stuff, i have the search
routine send me back an array of hashes that represent the search results,
like this:


my $i = 1; my @swish_return;
while ( (my $result = $results->NextResult) && ($i <=  $max_res) )
{
                my $res;
                my @props = $result->PropertyList; my $prop;
                        foreach $prop(@props){
                        $res->{$prop->Name}=$result->Property( $prop->Name );
                        }
                push (@swish_return,$res);
                $i++;
}

then i return @swish_return and use it to build the rows. usually by
sending the individual hashes to a template parser, like:

	my $row_fmt = $self->template('SearchResults');
	for my $result_hash(@results){
	$resultsrow .= $row_fmt->parse($result_hash);
        }

the parse function replaces the placeholders in the template with the
values in the hash.

this has always worked great, until today (queue ominous music);

now, I am trying to wrap this all in a Soap::Lite web service, and

suddenly, whenever i try to access the items in the @swish_return array i
get this error:

    Bad index while coercing array into hash

    Data::Dumper shows the hash just fine.

anyway, I am sure that my description has been both lacking and
uninformative, but if anyone would care to toss me a line here, i
can take my head out of the oven.

Brad
------------------------------------------------------------
 Brad Miele
 Technology Director
 IPNStock
 (866) 476-7862 x902
 bmiele@ipnstock.com

 Warp 7 -- It's a law we can live with.
Received on Mon Jan 24 13:27:46 2005