On Jul 18, 2010, at 11:29 AM, Ævar Arnfjörð Bjarmason wrote:

On Sun, Jul 18, 2010 at 15:11, Dave Rolsky <[email protected]> wrote:
On Sun, 18 Jul 2010, Ævar Arnfjörð Bjarmason wrote:

2b54d2a6b7bf40c4408ffbc117f6b6d77ee35c67 by Dave Rolsky broke this
DWIM MX::Getopt program:

<snip>


Can this be made to work instead of dying? Perhaps a coercion needs to
be added to MooseX::Getopt?

Well, it shouldn't die any more, just warn. But it still should be fixed.

I don't understand why you're passing "coerce => 1" there. Where is the
coercion defined?

Indeed it should. When I wrote this I /thought/ that the coerce
argument was what was doing the "foo=bar" -> { foo => "bar" }
magic. But evidently not, it works just fine without it.


No, MooseX::Getppt sees the HashRef type and then treats the --args attribute as key-value pair arguments (see Getopt::Long for details on this feature). No type coercions are done at all unless you specifically ask for them.

Just a side note, this would have required we add a coercion on the core HashRef type, which is considered extremely bad manners since the core types are shared by all and global and should never have coercions added to them.

- Stevan






Reply via email to