Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by daxim (Chaplain)
on Oct 04, 2012 at 15:25 UTC ( #997250=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997250]
help
Chatterbox?
and the radiator hisses contentedly...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-02-26 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (376 votes). Check out past polls.