I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2012-02-03 11:02:22.813976-08 by wsppan in response to 13618
Re: sub command dispatching confusion
OK, figured it out. Subclass dispatching works like this. It finds all the subclasses of the command class (via inheritance) and adds them to the _subcommands field of the command class:

CLI::Framework::Command::register_subcommand(lib/CLI/Framework/Command.pm:264): 264: my $subcommand_name = $subcommand_obj->name(); CLI::Framework::Command::register_subcommand(lib/CLI/Framework/Command.pm:265): 265: $cmd->{_subcommands}->{$subcommand_name} = $subcommand_obj;

and the name() method is:
sub name { my ($cmd) = @_; # Use base name of package as command name... my $pkg = ref $cmd; my @pkg_parts = split /::/, $pkg; return lc $pkg_parts[-1]; }


If I want to use a different subcommand name I can override the name() method in my subcommand class.

Still not sure what happens if I create 2 subcommands classes (no overrides to name()) that inherit from My::Queue::Command::Property:

My::Queue::Command::Property::List
My::Other::Property::List

Which one gets called with the 'list' subcommand?
Direct Responses: Write a response