Tuesday, 27 December 2022

How can we get name of running Perl script?


Method1: 

running script can be found using $0 variable
print $0;

Method2: 

print __FILE__;

Method3:

use File::Basename;
my $name = basename($0);

Labels: , , ,

0 Comments:

Post a Comment

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

<< Home