Octavian Rasnita schrieb:
Hi,
[...]
package TestMod;
use Moose;
has foo = (is = 'ro', isa = 'Int', default = 123);
__PACKAGE__-meta-make_immutable;
package main;
use strict;
[...]
#This doesn't work because foo is undefined:
my $t = TestMod-new(foo = undef);
print $t-foo;
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
On 29/01/11 07:23, Octavian Rasnita wrote:
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
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 but with an undef value.
Use MooseX::UndefTolerant.
On 29/01/11 13:20, Hans Dieter Pearcey wrote:
On Sat, 29 Jan 2011 09:23:45 +0200, Octavian Rasnitaorasn...@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 but
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 but with