On Thu Aug 18 16:40:24 2011, DAGOLDEN wrote:
Show quoted text> Please add a coercion for objects that stringifies them
For any object (other than Path::Class::File/Dir), please stringify them
during coercion. E.g. "$arg". This allows any file-like object that
stringifies into a path to be used seamlessly.
Consider a File::Temp object used to initialize an attribute of type
Dir. A File::Temp object stringifies into a path, but can't be coerced
into a Path::Class::Dir type because it's an object not a path:
C.f. attached demo script and module
Attribute (dir) does not pass the type constraint because: Validation
failed for 'MooseX::Types::Path::Class::Dir' with value
File::Temp=GLOB(0xbc1f68) at reader RT70350::dir (defined at RT70350.pm
line 10) line 18
RT70350::dir('RT70350=HASH(0xba2f98)') called at rt70350.pl line 8