develooper Front page | perl.perl6.users | Postings from May 2018

What is my sub?

Thread Next
From:
ToddAndMargo
Date:
May 22, 2018 06:05
Subject:
What is my sub?
Message ID:
ae355f07-7823-5500-cc7d-23dfc54debb5@zoho.com
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))[3] ) ~~ s{.*::}{};

How do I do it in Perl 6?

Many thanks,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About