Tuesday, 3 September 2019

How to get current subroutine name in Perl and ways to do it?



Method 1:
   
             print __LINE__;


Method 2:

     By Using caller() function:

              my $sub_name = (caller(0))[3];


Method 3:

     By Using Sub::Identify Module:
   
             print __SUB__ ;


kaavannan perl blogspot

Labels: ,

0 Comments:

Post a Comment

Note: only a member of this blog may post a comment.

<< Home