Hi Folks,

I have an array of "facet" objects called @facets. A "facet" object has a 
method called facet_name. I would like to output this using dynamic tables, 
instead of having to do an Embperl foreach loop. The following Embperl foreach 
loop works:

   <table>
   [$ foreach $facet (@facets) $]
      <tr>
         <td>[+ $facet->facet_name +]</td>
      </tr>
   [$ endforeach $]
   </table>

However when I try using an Embperl dynamic table (as desired) like the 
following:

   <table>
      <tr>
         <td>[+ $facets[$row]->facet_name +]</td>
      </tr>
   </table>

I get an error:

   [1381]ERR: 24: Error in Perl code: Can't call method "facet_name" on an 
undefined value at /usr/local/mylibrary/index.epl line 17.

Oddly enough, the following works (using a literal value of zero instead of 
$row):

   <table>
      <tr>
         <td>[+ $facets[0]->facet_name +]</td>
      </tr>
   </table>

And also this works too, even though it isn't the output I'm looking for: (It's 
not calling facet_name)

   <table>
      <tr>
         <td>[+ $facets[$row] +]</td>
      </tr>
   </table>

What am I doing wrong? It seems to me like something funky is going on with 
$row.

Gavin Spomer
Systems Programmer
Brooks Library
Central Washington University

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

Reply via email to