invoke a subroutine indirectly via glob references
4 views
Skip to first unread message
Rainer Weikusat
unread,
Jan 4, 2022, 11:17:44 AM1/4/22
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Assuming that an array element $l[0] holds a reference to a glob, the
subroutine currently associated with this glob can be invoked via
*{$l[0]}->(1, 2, 3)
with an explicit argument list or as
&{*{$l[0]}}
with the current @_.
The idea behind this is that the subroutine associated with the glob
might change in future and that the expression should then invoke the
'current' function and not the old one.