in reply to why use a coderef?
superdoc:
Could it be that when you call 'some_subroutine()' with a certain parameter it alters the globally scoped variable '$coderef'? IF 'some_subroutine' looked like this:
sub some_subroutine { if ($_[0] eq 'arg1') { $coderef = \&some_other_subroutine; } return ($value1, $value2); }
The second calls to '$coderef' with 'arg2/3' will call '&some_other_subroutine'. This is the nature of the coderef -- my logic is wired to the '$codref' and the executing code can change where that reference points to.
I suppose this could be 'the basics' of it, but if you're looking for *deeper* insight, I'm sure we could provide some of that too... :-)
Kurt
|
|---|