Skip Menu |

This queue is for tickets about the MooseX-Getopt CPAN distribution.

Report information
The Basics
Id: 101938
Status: resolved
Priority: 0/
Queue: MooseX-Getopt

People
Owner: ether [...] cpan.org
Requestors: jlmartinez [...] capside.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.66
Fixed in: 0.67



Subject: MooseX::Getopt doesn't play good with MooseX::StrictConstructor (sometimes)
Hi, I've caught quite an edge case: MooseX::Getopt, when used in conjunction with MooseX::StrictConstructor can blow up if you use new_with_options(argv => [...]). The problem comes to be that new_with_options tries to call new, passing the argv parameter too. Since the class being instanced most likely won't have an argv attribute, MooseX::StrictConstructor will make it blow up. This is a small example of how to reproduce: #!/usr/bin/env perl use strict; use warnings; use Data::Printer; package X { use Moose; with 'MooseX::Getopt'; use MooseX::StrictConstructor; has a => (is => 'ro', isa => 'Str'); has b => (is => 'ro', isa => 'Str'); } my $o = X->new_with_options(argv => [ '--b', 'b' ]); # Never get here ("argv" isn't an attribute of X) :( p $o; I've gone ahead, forked and tried to fix the issue and made a pull request on GitHub. Hope it helps! Jose Luis Martinez JLMARTIN
thanks, fixed in 0.67!