Skip to main content.
home | support | download

Back to List Archive

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

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Mon Jan 24 2005 - 22:22:50 GMT
Brad Miele wrote on 1/24/05 3:53 PM:

> so it is obviously a Soap issue, and not one for this list, but, now i
> have you intrigued!
> 

yes, damnit. a good sense of humour always pulls me in...

> anyway, if i instead do:
> 
> for my $res(@results){
>         print STDERR Dumper($res)."\n";
> }
> 
> i get:
> 
> $VAR1 = [
>           {
>             'swishdbfile' => '/usr/local/indexes/ipn_ex_stem.index',
>             'newsweight' => '2',
..
> 
> which seems to indicate that the hash is valid at least, i saw the
> perldiag note on the error, but i didn't understand what it meant exactly.
> 


so $res is an ARRAY ref, which contains a HASH ref. I thought $res was supposed 
to be a HASH ref by itself?

from your earlier post:

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++;
}

so if $res is a HASH ref, why is Dumper printing it as an ARRAY ref containing a 
HASH ref?

follow?

I would expect Dumper to print:

$VAR = {
	'swishdbfile' ....


instead.

-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Mon Jan 24 14:22:50 2005