App-LDAP
view release on metacpan or search on metacpan
inc/Module/Install/Makefile.pm view on Meta::CPAN
BEGIN {
$VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
# ways based on the MM version.
my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
# If we are passed a param, do a "newer than" comparison.
# Otherwise, just return the MakeMaker version.
lib/App/LDAP/Command/Add/Host.pm view on Meta::CPAN
my ($self) = shift;
my $hostname = $self->extra_argv->[2] or die "no hostname specified";
die "host $hostname already exists" if App::LDAP::LDIF::Host->search(
base => config()->{nss_base_hosts}->[0],
scope => config()->{nss_base_hosts}->[1],
filter => "cn=$hostname",
);
my $ip = prompt('x', 'ip address:', '', '');
my $host = App::LDAP::LDIF::Host->new(
base => $self->base // config()->{nss_base_hosts}->[0],
cn => [$hostname],
ipHostNumber => $ip,
);
$host->save;
$host;
( run in 0.502 second using v1.01-cache-2.11-cpan-6aa56a78535 )