App-pepper

 view release on metacpan or  search on metacpan

lib/App/pepper.pm  view on Meta::CPAN

        '-input'    => __FILE__,
    );
    exit;
}

my $handlers = {
    'timeout'        => \&handle_timeout,
    'ssl'            => \&handle_ssl,
    'host'            => \&handle_host,
    'port'            => \&handle_port,
    'credentials'    => \&handle_credentials,
    'id'            => \&handle_id,
    'pw'            => \&handle_pw,
    'newpw'            => \&handle_newpw,
    'connect'        => \&handle_connect,
    'login'            => \&handle_login,
    'logout'        => \&handle_logout,
    'hello'            => \&handle_hello,
    'check'            => \&handle_check,
    'info'            => \&handle_info,
    'poll'            => \&handle_poll,

lib/App/pepper.pm  view on Meta::CPAN

            note("Connected OK. Type 'hello' to see the greeting frame.");

        } else {
            error("Unable to connect: %s", $Net::EPP::Simple::Message);

        }
        return $result;
    }
}

sub handle_credentials {
    if ($_[0] eq '') {
        return error('Missing client ID');

    } elsif ($_[1] eq '') {
        return error('Missing password');

    } else {
        handle_id($_[0]) && handle_pw($_[1]);
        return 1;

lib/App/pepper.pm  view on Meta::CPAN

    if (!$epp->connected) {
        return handle_connect() && handle_login();

    } elsif ($epp->authenticated) {
        return error('Already logged in');

    } elsif ($epp->{'host'} eq '') {
        return error('No host specified');

    } elsif ($epp->{'user'} eq '' || $epp->{'pass'} eq '') {
        return error('No credentials specified');

    } else {
        note("Attempting to login as '%s'...", $epp->{'user'});
        $epp->{'quiet'} = ($verbose ? 0 : 1);
        my $result = $epp->_login;
        $epp->{'quiet'} = 0;
        if ($result) {
            note('Logged in OK!');

        } else {

lib/App/pepper.pm  view on Meta::CPAN

}

sub handle_help {
    my $cmd = lc(shift || 'help');

    my %map = (
        'timeout'            => 'SYNTAX/Connection Management',
        'ssl'                => 'SYNTAX/Connection Management',
        'host'                => 'SYNTAX/Connection Management',
        'port'                => 'SYNTAX/Connection Management',
        'credentials'        => 'SYNTAX/Session Management',
        'id'                => 'SYNTAX/Session Management',
        'pw'                => 'SYNTAX/Session Management',
        'newpw'                => 'SYNTAX/Session Management',
        'connect'            => 'SYNTAX/Connection Management',
        'login'                => 'SYNTAX/Session Management',
        'logout'            => 'SYNTAX/Session Management',
        'hello'                => 'SYNTAX/Session Management',
        'check'                => 'SYNTAX/Query Commands/Availability Checks',
        'info'                => 'SYNTAX/Query Commands/Object Information',
        'poll'                => 'SYNTAX/Session Management',



( run in 0.262 second using v1.01-cache-2.11-cpan-4d50c553e7e )