![]() |
|
Think about Loose Coupling | |
PerlMonks |
Re^5: logfile rotate w/ pass by referenceby Joost (Canon) |
on Mar 14, 2005 at 17:53 UTC ( #439380=note: print w/replies, xml ) | Need Help?? |
It doesn't need to know the name of the variable that is being passed. That's whole point of having subroutine arguments in the first place.
All your logroll function needs to know is the name of the file. The name of the file is the value of the argument. The name of the variable is not important.
This is all documented in the perlfunc manpage. update: I see I mistyped the code in the previous example. Maybe my update will make it clearer. :-)
In Section
Seekers of Perl Wisdom
|
|