in reply to How do I get a reference to a builtin function?
Now, if this specific magic is on your mind I will be of no help, but I offer this to try and satisfy your builtin reference cravings:
Since uc expects only a scalar we'll have to pick the first element of @_ for it. You may elect to use join as means to handle arrays in your call to "sub".my(%hash) = ( "sub" => sub { uc $_[0] }, ); print $hash{"sub"}->("hello");
Your referencing strategy will differ slightly from function to function depending on what you want to accomplish.
Originally posted as a Categorized Answer.
|
---|