I have a big object oriented module based on a hash. There's one list inside this module. I would like to have this list also as an object. But I wanted to try it without a separate module. So I want to have two packages in one module.
It is working if I specify the name directly. But if I want to have the name of the subpackage dependent on the name of the main package, I get an error. My code looks like this.
use strict; use warnings; package My; my $pkg_sub; BEGIN { $pkg_sub = __PACKAGE__ . '::A'; } # some methods package $pkg_sub; # My::A # some methods 1;
What am I doing wrong?
In reply to Name of subpackage dependent on main package by Dirk80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |