NAME

Acme::Perl::Consensual - check that your version of Perl is old enough to consent

DESCRIPTION

This module checks that your version of Perl is old enough to consent to sexual activity. It could be considered a counterpart for Modern::Perl.

Constructor

new(locale => $locale) Creates a new Acme::Perl::Consensual object which can act as an age of consent checker for a particular locale. The locale string should be an ISO 3166 alpha2 country code such as "US" for the United States, "GB" for the United Kingdom or "DE" for Germany. It may optionally include a hyphen followed by a subdivision designator, such as "US-TX" for Texas, United States, "AU-NSW" for New South Wales, Australia or "GB-WLS" for Wales, United Kingdom. If the locale is omitted, the module will attempt to extract the locale from the LC_LEGAL or LC_ALL environment variable.

Methods

locale Returns the locale provided to the constructor, or detected from environment variables, lower-cased. can(%details) Given a person's details (or a piece of software's details), returns 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

Passing a "-check" parameter on import:

use Acme::Perl::Consensual -check;

is a shorthand for:

BEGIN { require Acme::Perl::Consensual; Acme::Perl::Consensual->new()->perl_can() or die "Perl $] failed age of consent check, died"; }

That is, it's the opposite of use Modern::Perl . It requires your version of Perl to be past the age of consent in your locale.

CAVEATS

Most jurisdictions have legal subtleties that this module cannot take into account. Use of this module does not constitute a legal defence.

Even if you obtain consent from Perl, there are practical limits to what you could actually do with it, sexually.

INSTALL

While this distribution is believed to work in any version of Perl 5, it has only been tested so far in Perl 5.8+. In older versions of Perl, Makefile.PL may not run, but the library can be manually installed by copying lib/Acme/Perl/Consensual.pm to an appropriate location.

BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Acme-Perl-Consensual.

SEE ALSO

Sex, XXX.

AUTHOR

Toby Inkster <tobyink@cpan.org>, but MSCHWERN deserves at least a little of the blame.

COPYRIGHT AND LICENCE

This software is copyright (c) 2012 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.