http://www.perlmonks.org?node_id=997250


in reply to How to export multiple packages in one file to another Perl program?

Constants belong to a package and do not pass down inheritance, so this is not suitable for OO. You want read-only attributes.
package Object2; use Moose; has 'some_attr', is => 'ro', default => 42; ################## package main; my $o = Object2->new; $o->some_attr; # returns 42
  • Comment on Re: How to export multiple packages in one file to another Perl program?
  • Download Code