Bug in Moose, Moo or forks?

2015-02-25 Thread Octavian Rasnita
Hello, I have the following test code. Here Moose and Moo are not useful so can be commented, but in production code they are needed. use forks; use Moose; use Moo; $SIG{__DIE__} = sub { print thread died: @_\n if @_; exit; }; my $thread = threads-create( sub { print Thread running\n;

Default values for undef attributes

2011-01-29 Thread Octavian Rasnita
Hi, I want to use some attributes that get a default value when they are not sent as constructor's parameters and also when they are sent as constructor parameters but with an undef value. I have gave an example below and shown that the third way of constructing the object doesn't work

Re: Default values for undef attributes

2011-01-29 Thread Octavian Rasnita
From: Hans Dieter Pearcey h...@pobox.com On Sat, 29 Jan 2011 09:23:45 +0200, Octavian Rasnita orasn...@gmail.com wrote: I want to use some attributes that get a default value when they are not sent as constructor's parameters and also when they are sent as constructor parameters

Bug?

2010-06-26 Thread Octavian Rasnita
Hi, I have tried the following sample of using inner/augment from the Moose manual: package Document; use Moose; sub as_xml { my $self = shift; my $xml = document\n; $xml .= inner(); $xml .= /document\n; return $xml; } package Report; use Moose; extends 'Document'; augment

Defining attributes

2010-06-19 Thread Octavian Rasnita
Hi, Just as a curiosity, why the following syntax works: has $_ = (is = 'rw', isa = 'Str') for 'a' .. 'zz'; but the following one doesn't: has $_ = (is = 'rw', isa = 'Str') for 'a' .. 'zzz'; Is the number of attributes that can be defined limited? Thanks. Octavian

Coercing a type that can be undef

2010-06-14 Thread Octavian Rasnita
Hello, I am trying to create a module that accepts a string property as 2010-05-01 and coerces it to DateTime by default, but that property might be also undef. I have tried: package Foo; use Moose; use Moose::Util::TypeConstraints; use DateTime; use DateTime::Format::Natural; subtype