Sometime on Oct 9, Mark Stosberg assembled some asciibets to say:

> $t->param(
>       my_loop_var => sub {
>               # return an a reference to an array of hash refs
>       }
> );

Simply put, when you pass the subroutine definition to the param
function, you're passing a reference to the subroutine.  The subroutine
does not get executed at that point.  From the perlfunc man page:

   Without a NAME, it's an anonymous function declaration, and does
   actually return a value: the CODE ref of the closure you just
   created.

You should define your function elsewhere, and just call it from your
param:

param(my_loop_var => &function);

sub function {
        ...
}

Philip

-- 
Time is fluid ... like a river with currents, eddies, backwash.
                -- Spock, "The City on the Edge of Forever", stardate 3134.0


Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/

  MSN  philiptellis                         Yahoo!  philiptellis
  AIM  philiptellis                         ICQ     129711328


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

Reply via email to