1. Perl
  2. builtin functions
  3. here

__PACKAGE__ - Get package name

You can get package name by specifying __PACKAGE__ .

__PACKAGE__

Example program

This is an example to get the package name.

package SomePackage;
use strict;
use warnings;

# Get package name
my $package_name = __PACKAGE__;

Related Informatrion