in reply to Of moose and ducks (or: how to coerce from non-Moose type objects)
You could have also done this ...
Moose class types are not restricted to Moose created classes, you can make one for any plain old Perl class. Of course the version you have is more flexible, assuming you know you can trust the seq method.class_type('Bio::Seq'); coerce 'DNAString' => from 'Bio::Seq' => via { $_->seq };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Of moose and ducks (or: how to coerce from non-Moose type objects)
by tospo (Hermit) on Jan 10, 2011 at 10:51 UTC |