in reply to Type Constraints in Moose

It works exactly as posted for me (well, I did add a backslash to the first call to Dumper). I'm using Moose 0.40 here, what version are you using?
$VAR1 = [ 1, 2 ]; $VAR1 = bless( { 'somearray' => [ 1, 2 ] }, 'MyClass' );

Replies are listed 'Best First'.
Re^2: Type Constraints in Moose
by skirnir (Monk) on Apr 06, 2008 at 16:49 UTC
    I was using the libmoose-perl package of ubuntu 7.10. It turned out to be Moose 0.21.
    I wouldn't have thought that they were that far behind, so I didn't check versions before.
    Sorry, my fault. It works like a charm now with 0.40. Thanks for your help!
      For future reference, (and hoping Ubuntu works the same as Debian):

      When a CPAN module is out of date on Debian, or not available, I use dh-make-perl <module-name> to create my own package and install it with dpkg or apt-get. Mostly it works great, and has the advantage that if the Debian maintainer updates their package, apt-get (or whatever) will do the right thing.