<?xml version="1.0" encoding="windows-1252"?>
<node id="997250" title="Re: How to export multiple packages in one file to another Perl program?" created="2012-10-04 11:25:15" updated="2012-10-04 11:25:15">
<type id="11">
note</type>
<author id="626393">
daxim</author>
<data>
<field name="doctext">
Constants belong to a package and do not pass down inheritance, so this is not suitable for OO. You want read-only attributes.
&lt;code&gt;
package Object2;
use Moose;
has 'some_attr', is =&gt; 'ro', default =&gt; 42;

##################

package main;
my $o = Object2-&gt;new;
$o-&gt;some_attr; # returns 42
&lt;/code&gt;</field>
<field name="root_node">
997244</field>
<field name="parent_node">
997244</field>
</data>
</node>
