> On 22 May 2018, at 09:41, ToddAndMargo wrote:
>
> On 05/21/2018 11:21 PM, Siavash wrote:
>> https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
>> On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I need to know the name of the subroutine I am in.
>>>
>>> T
On 05/22/2018 09:34 AM, Elizabeth Mattijsen wrote:
On 22 May 2018, at 09:41, ToddAndMargo wrote:
On 05/21/2018 11:21 PM, Siavash wrote:
https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
Hi All,
I need to know the name of the
On 05/22/2018 09:09 AM, yary wrote:
Oh this works too
sub my-name-is-Sue () { say "Hi, ", &?ROUTINE.name }
my-name-is-Sue;
-y
Thank you!
> On 22 May 2018, at 09:41, ToddAndMargo wrote:
>
> On 05/21/2018 11:21 PM, Siavash wrote:
>> https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
>> On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I need to know the name of the subroutine I am in.
>>>
>>> T
Oh this works too
sub my-name-is-Sue () { say "Hi, ", &?ROUTINE.name }
my-name-is-Sue;
-y
On Tue, May 22, 2018 at 8:59 AM, yary wrote:
> I was surprised there isn't a cleaner way to get a sub/method names, and
> found https://docs.perl6.org/language/5to6-perlfunc#caller
>
> Try this tasty mors
I was surprised there isn't a cleaner way to get a sub/method names, and
found https://docs.perl6.org/language/5to6-perlfunc#caller
Try this tasty morsel
who-am-i () { say "I'm ", callframe(0).code.name }
who-am-i;
-y
On Tue, May 22, 2018 at 12:41 AM, ToddAndMargo
wrote:
> On 05/21/2018 11:2
On 05/21/2018 11:21 PM, Siavash wrote:
https://www.nntp.perl.org/group/perl.perl6.users/2017/03/msg3423.html
On 2018-05-22 06:04:47 GMT, ToddAndMargo wrote:
Hi All,
I need to know the name of the subroutine I am in.
This is the way I use to do it in Perl 5:
(my $Name = (caller(0))