What is the different between the following code in case of taking reference to function
my $func_name = "funcname"; &$func_name();
my $funcref=\&thefunc; $funcref->();
When I execute the first one strict pragma throws error as, Can't use string ("thefunc") as a subroutine ref while "strict refs" in use at pl.pl line 26. So I get know that it uses symbolic references, not real (hard) references, so it is forbidden under the use strict 'refs' pragma. any other difference?
In reply to Taking reference to function by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |