use strict; use warnings; my %op = ( 'toupper' => \*uc{CODE}, #... ); print( $op{toupper}->('foo'), "\n" );
Name "main::uc" used only once: possible typo at a.pl line 5. Not a CODE reference at a.pl line 10.
Originally posted as a Categorized Answer.
In reply to Re: How do I get a reference to a builtin function?
by ikegami
in thread How do I get a reference to a builtin function?
by adram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |