in reply to Re: Hiding, but maintaining variables in user-defined code
in thread Hiding, but maintaining variables in user-defined code

To follow up yet again, I did find something that might help, but will lead into a worse dead end.

That is, if you call a function via the amperstand approach, with no arguements, the current value of @_ is passed along to that function. So in my case:

$test->execute( sub { print "in the local coderef\n"; &MyPackage::helper; } );
the value of @_ that helper() sees would be whatever execute() left @_ as, so here, I could easily fill up @_ with $self and any other variables that I wish. However... some of the functions of similar nature to helper that I have planned would also require user-added arguments, and thus this completely breaks down, since specifying any arguements does not pass @_ further.

I think what I will end up doing is forcing the user to specify "$self->helper", and then remove any variables that would be passed to the help functions from access by the user.

</CODE>


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain