CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Moose attribute using my own class def

 



trysil
Novice

Jun 30, 2011, 4:25 AM

Post #1 of 2 (853 views)
Moose attribute using my own class def Can't Post

Hi!
I have a class foo with a attribute "attr":


Code
package foo; 
use Moose;

has 'attr' => (
is => "rw",
isa=>"MyClass",
...
);

...


How do I initiate 'attr'? Somehow I need to call 'new' for the attr to initiate my can't see how... or am I just blind and stupid?


trysil
Novice

Jul 1, 2011, 9:22 AM

Post #2 of 2 (838 views)
Re: [trysil] Moose attribute using my own class def [In reply to] Can't Post

It's okay... It's me being stupid as usual Blush
(Just add a 'builder' to the attribute definition... It's so strange... some things gets so obvious when you sleep on it...)

/T


(This post was edited by trysil on Jul 1, 2011, 9:24 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives