Subject: | Implement MooseX::App::Cmd command using Moops |
Date: | Mon, 03 Feb 2014 13:10:06 +0100 |
To: | bug-Moops [...] rt.cpan.org |
From: | Sven Schober <sven.schober [...] uni-ulm.de> |
Hi!
I am trying to implement a
[MooseX::App::Cmd](http://search.cpan.org/~mjgardner/MooseX-App-Cmd-0.27/lib/MooseX/App/Cmd.pm)
command using Moops. As long as I keep the code in a single file
everything works nicely:
#!/usr/bin/env perl
package myapp::Command;
use Moops;
class cmd1
extends MooseX::App::Cmd::Command
using Moose {
method description { return "cmd1"; };
method execute( $opt, $args) {
print "Hello World\n";
};
}
package main;
use Moops;
class myapp extends MooseX::App::Cmd using Moose;
use Modern::Perl;
use myapp;
myapp->run;
But as soon as I move the definition of `cmd1` to a file
`myapp/Command/cmd1.pm` perl complains about the module not returning a
true value:
$ perl mycmd
myapp/Command/cmd1.pm did not return a true value at
/usr/share/perl5/site_perl/App/Cmd.pm line 203.
The documentation [explicitly
states](http://search.cpan.org/~tobyink/Moops-0.030/lib/Moops.pm#Outer_Sugar)
the `1;` is not needed.
Using `true` won't help either...
`App::Cmd` uses `Class::Load::load_class()` to load the command classes,
so maybe there's a problem there?
My Environment:
perl: 5.18.2
Moops: 0.030
MooseX::App::Cmd: 0.27
$ uname -a
Linux ylo 3.12.5-1-ARCH #1 SMP PREEMPT Thu Dec 12 12:57:31 CET 2013
x86_64 GNU/Linux
Cheers
Sven
--
Dipl.-Inf. Sven Schober
Universität Ulm
kiz - Abteilung Infrastruktur
89069 Ulm
Tel.: +49 731 50 22484
Message body not shown because it is not plain text.