in reply to Re^2: Function name in a variable, can't recall the concept
in thread Function name in a variable, can't recall the concept
More there are:
use strict; use warnings; sub tst { warn "tst($_[0]) called\n" } my $symbol="tst"; ($::{$symbol})->(1); &{$::{$symbol}}(2); (main->can($symbol))->(3); &{main->can($symbol)}(4);
C:/Perl_524/bin\perl.exe d:/exp/symbolic_references.pl tst(1) called tst(2) called tst(3) called tst(4) called
NB:
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Function name in a variable, can't recall the concept
by ikegami (Patriarch) on Apr 15, 2019 at 00:54 UTC | |
by LanX (Saint) on Apr 15, 2019 at 11:25 UTC | |
by ikegami (Patriarch) on Apr 16, 2019 at 19:14 UTC |