POE-Component-ControlPort

 view release on metacpan or  search on metacpan

lib/POE/Component/ControlPort.pm  view on Meta::CPAN


    my @commands = (
       {
           help_text    => 'My command',
           usage        => 'my_command [ arg1, arg2 ]',
           topic        => 'custom',
           name         => 'my_command',
           command      => sub {
              my %input = @_;
              
              local @ARGV = @{ $input{args} };
              GetOptions( ... ); 
           },
       } 
    );


    POE::Component::ControlPort->create(
        local_address   => '127.0.0.1',
        local_port      => '31337',
    

lib/POE/Component/ControlPort.pm  view on Meta::CPAN


    my @commands = (
       {
           help_text    => 'My command',
           usage        => 'my_command [ arg1, arg2 ]',
           topic        => 'custom',
           name         => 'my_command',
           command      => sub {
              my %input = @_;
              
              local @ARGV = @{ $input{args} };
              GetOptions( ... ); 
           },
       } 
    );


A command is defined by a hash of metadata and a subroutine reference. The
metadata helps to group commands into functional units as well as display help
and usage information for the confused user.  The meat of a command, obviously,
is the subroutine reference which makes up the 'command' part of the metadata.



( run in 0.450 second using v1.01-cache-2.11-cpan-49f99fa48dc )