Acme-Perl-Consensual
view release on metacpan or search on metacpan
true if they are legally able to consent. For example:
my $can_consent = $acme->can(age => 26, married => 1);
Currently recognised details are 'age' (in years), 'married' (0 for
no, 1 for yes) and 'puberty' (0 for no, 1 for yes).
If called with a single scalar argument, acts like UNIVERSAL::can
(see UNIVERSAL).
"age_of_perl_in_seconds($version)"
The age of a particular release of Perl, in seconds. (Actually we
don't know exactly what time of day Perl was released, so we assume
midnight on the release date.)
If $version is omitted, then the current version.
"age_of_perl($version)"
As per "age_of_perl_in_seconds", but measured in years. Returns a
floating point. Use POSIX::floor to round down to the nearest whole
number. This method assumes that all years are 365.24 days long, and
all days are 86400 (i.e. 24*60*60) seconds long.
"perl_can($version)"
Shorthand for:
$acme->can(
age => POSIX::floor($acme->age_of_perl($version)),
puberty => 1, # Perl is regarded as a mature programming language
);
Import
inc/Module/Install/AutoInstall.pm view on Meta::CPAN
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
}
$self->requires(@deduped);
$self->makemaker_args( Module::AutoInstall::_make_args() );
my $class = ref($self);
$self->postamble(
"# --- $class section:\n" .
Module::AutoInstall::postamble()
);
}
sub installdeps_target {
my ($self, @args) = @_;
$self->include('Module::AutoInstall');
require Module::AutoInstall;
inc/Module/Install/Metadata.pm view on Meta::CPAN
$self->provides( %{ $build->find_dist_packages || {} } );
}
sub feature {
my $self = shift;
my $name = shift;
my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
# The user used ->feature like ->features by passing in the second
# argument as a reference. Accomodate for that.
$mods = $_[0];
} else {
$mods = \@_;
}
my $count = 0;
push @$features, (
$name => [
map {
inc/Module/Install/Package.pm view on Meta::CPAN
sub _final {
my ($self) = @_;
$self->_all_from;
$self->_requires_from;
$self->_install_bin;
$self->_install_share;
$self->_WriteAll;
}
#-----------------------------------------------------------------------------#
# This section is where all the useful code bits go. These bits are needed by
# both Author and User side runs.
#-----------------------------------------------------------------------------#
my $all_from = 0;
sub _all_from {
my $self = shift;
return if $all_from++;
return if $self->name;
my $file = shift || "$main::PM" or die "all_from has no file";
$self->all_from($file);
lib/Acme/Perl/Consensual.pm view on Meta::CPAN
return undef unless defined $provides->{$_};
return !1 unless $provides->{$_} >= $requires->{$_};
}
!0;
}
sub age_of_perl
{
my $class = shift;
return $class->age_of_perl_in_seconds(shift)
/ 31_556_736 # 365.24 * 24 * 60 * 60
}
sub age_of_perl_in_seconds
{
my ($class, $v) = @_;
$v ||= $];
my $pl_date = do
{
$class->_perlhist;
my $date = $perlhist{$v};
unless ($date)
lib/Acme/Perl/Consensual.pm view on Meta::CPAN
they are legally able to consent. For example:
my $can_consent = $acme->can(age => 26, married => 1);
Currently recognised details are 'age' (in years), 'married' (0 for no, 1 for
yes) and 'puberty' (0 for no, 1 for yes).
If called with a single scalar argument, acts like UNIVERSAL::can (see
L<UNIVERSAL>).
=item C<< age_of_perl_in_seconds($version) >>
The age of a particular release of Perl, in seconds. (Actually we don't know
exactly what time of day Perl was released, so we assume midnight on the
release date.)
If C<< $version >> is omitted, then the current version.
=item C<< age_of_perl($version) >>
As per C<age_of_perl_in_seconds>, but measured in years. Returns a floating
point. Use POSIX::floor to round down to the nearest whole number. This
method assumes that all years are 365.24 days long, and all days are 86400
(i.e. 24*60*60) seconds long.
=item C<< perl_can($version) >>
Shorthand for:
$acme->can(
age => POSIX::floor($acme->age_of_perl($version)),
puberty => 1, # Perl is regarded as a mature programming language
);
( run in 0.839 second using v1.01-cache-2.11-cpan-39bf76dae61 )