|Do you know where your variables are?|
Passing references to subroutines with parametersby aijin (Monk)
|on Jul 12, 2001 at 22:17 UTC||Need Help??|
aijin has asked for the
wisdom of the Perl Monks concerning the following question:
Alright, I know I can do this:
But is it possible to pass a referenced subroutines with it parameters, and then call it with more parameters in the receiving subroutine without losing parameters?
...but it loses the "lalala" parameter and ends up with errors all over the place. Admittedly, I'm not too solid with the whole passing referenced subroutines concept.
What I'm trying to set up is a function which gets passed with a filename as a parameter. This function then gets called with a string over and over by the receiving function, does some nifty manipulation of said string, and then writes the results into the specified file.
I can't change the receiving subroutine, only the referenced one. Does anyone have a solution for me?