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: How can I get the name of the current subroutine in Perl, kaavannan perl blogspot
0 Comments:
Post a Comment
Note: only a member of this blog may post a comment.
<< Home