Skip to content →

Perl – Getting Package Names

Had an interesting question from a student i’ve been helping with a project. They were after the package name, for various reasons, and so I prepared a small example with 3 ways of doing 2 things. Heres the example:

The two main ways here, are with the __PACKAGE__ token, or using the ref function.

This also has an example of using Moo::Roles, and some of the basic things you can do with them.

Hopefully this is useful for people!

Published in Perl Perl Programming Quick Tips

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *