If I write a package like this:
    package Foo;
    use Moose;
    with
        'MooseX::Runnable',
        'MooseX::SimpleConfig',
        'MooseX::Getopt';

    sub run
    {
        print "I lived!\n";
    }

    1;

and a MooseX::Runnable script like this:

    use strict;
    use warnings;
    use lib '.';
    use MooseX::Runnable::Run;
    my $task = shift @ARGV;
    run_application $task, @ARGV;

why does this work:

perl run.pl Foo
    (prints: I lived!)

but this does not:

perl run.pl Foo --help

The second case dies in the middle of Getopt::Long::GetOptionsFromArray. This 
duplicates how GetOptionsFromArray is being called:

perl -MGetopt::Long -we'\
    my $opt_parser = Getopt::Long::Parser->new( config => [ qw( pass_through )] 
);\
    $opt_parser->getoptions( "configfile=s" => \$configfile );'\
-- --help

... and works just fine, so it would appear something is getting screwed up in
an eval block...

Help? :(



-- 
                 "Totally mad. Utter nonsense. But we'll do it
               because it's brilliant nonsense." - Douglas Adams
            .             .            .            .             .
Karen Etheridge, [email protected]       GCS C+++$ USL+++$ P+++$ w--- M++
http://etheridge.ca/                      PS++ PE-- b++ DI++++ e++ h(-)

Reply via email to