By analogy with what is possible with overloaded operators, is there a way to apply some kind of magic to a variable so that the following:
my $magic_var = ...;
some_function($magic_var);
will result in something like this:
call_function(\&some_function, $magic_var)
If some_functionit wasnโt defined, I could just use sub AUTOLOADto catch the call, but when itโs defined, I donโt know how to intercept the call (without something crazy, for example, for injection wrappers around all the callers or temporarily disinfect all the subsites) .
Another way to express this: I would like to write use overload sin => \&my_sin;, but have to sinbe some kind of function and call it as nomethoda sub when an overloaded object is used in a function call.
EDIT:
, , , Perl5 Perl6, . , Perl6 , , , Whatever, , ( ).
- , CPAN: Whatever.
/ .