Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法获取一段 perl 代码的封闭子程序的名称?例如:
sub foo { print where_am_i(); }
将输出'foo'.
'foo'
使用调用函数:
my $function = (caller(0))[3];