--- Canary-Stability/Stability.pm 2015/06/03 20:29:47 1.1 +++ Canary-Stability/Stability.pm 2015/06/04 16:18:26 1.2 @@ -8,7 +8,7 @@ =head1 DESCRIPTION -This is just a placeholder module, to be filled later. +This is just a placeholder module, to be filled in later. =over 4 @@ -17,13 +17,167 @@ package Canary::Stability; BEGIN { - $VERSION = 1996; #รค the year the ariane 5 crashed due to a software bug + $VERSION = 2001; # the year perl was accomodating enough to developers to foster weird ideas such as Coro +} + +sub sgr { + # we just assume ANSI almost everywhere + + # red 31, yellow 33, green 32 + + $ENV{PERL_CANARY_STABILITY_COLOUR} ne 0 + and ((-t STDOUT and length $ENV{TERM}) or $ENV{PERL_CANARY_STABILITY_COLOUR}) + and print "\e[$_[0]m"; } sub import { - # + my (undef, $distname, $minvers, $minperl) = @_; + + $ENV{PERL_CANARY_STABILITY_DISABLE} + and return; + + $minperl ||= 5.008002; + + if ($minvers > $VERSION) { + sgr 33; + print < + +Do not prompt the user on alert messages. + +=item C + +Disable use of colour. + +=item C + +Force use of colour. + +=item C + +Disable this modules functionality completely. + +=back + =head1 AUTHOR Marc Lehmann