Skip to main content.
home | support | download

Back to List Archive

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

From: <bmiele(at)not-real.ipnstock.com>
Date: Mon Jan 24 2005 - 22:40:15 GMT
don't confuse me with the facts!

it's all of these words that i get confused by.


@results is an ARRAY ref
the items in the ARRAY are HASH refs, or at least that is my intent.

for each item in @returned_results i am
expecting to have a hashref that i can pull items from like:

$_->{id} = '12345678';
$_->{swishdbfile} = '/usr/local/indexes/ipn_ex_stem.index';

etc...

does it seem like i have added a layer or something?

I am happy to return to banging my head against this, since the code works
outside of the Soap implimentation, it is most likely yet another Soap
Voodoo thing for me to figure out (and there have been many)...

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

 The meek shall inherit the earth -- they are too weak to refuse.


On Mon, 24 Jan 2005, Peter Karman wrote:

>
>
> 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:40:16 2005