| 1 | use Object::Pad ':experimental(:all)'; | ||
| 2 | |||
| 3 | package Net::SSLeay::CA::Base; | ||
| 4 | |||
| 5 | role Net::SSLeay::CA::Base; | ||
| 6 | |||
| 7 | use utf8; | ||
| 8 | use v5.40; | ||
| 9 | |||
| 10 | use Data::Dumper::Names; | ||
| 11 | use Time::HiRes; | ||
| 12 | use Time::Piece; | ||
| 13 | use Time::Moment; | ||
| 14 | use List::Util 'first'; | ||
| 15 | use Syntax::Keyword::Dynamically; | ||
| 16 | use Const::Fast; #::Exporter; | ||
| 17 | |||
| 18 | use vars qw'@ISA @EXPORT'; | ||
| 19 | |||
| 20 | use subs qw(dmsg epoch error success); | ||
| 21 | @EXPORT = qw(dmsg epoch err); | ||
| 22 | |||
| 23 | const our $DEBUG => $ENV{DEBUG} // 0; | ||
| 24 | const our $S_UNKNOWNERR => 'Unknown fatal error'; | ||
| 25 | |||
| 26 | eval "use Devel::StackTrace::WithLexicals" if $DEBUG; | ||
| 27 | |||
| 28 | # field $env : param(runenv) : inheritable { | ||
| 29 | # ( | ||
| 30 | # map { | ||
| 31 | # my $name = $_; | ||
| 32 | # my $val = | ||
| 33 | # first { $_ } @ENV{ map { uc "$_$name" } ( 'ca_', '' ) }; | ||
| 34 | # $name => $val | ||
| 35 | # } qw(verbose debug) | ||
| 36 | # ) | ||
| 37 | # } | ||
| 38 | # field $debug : accessor : param = $DEBUG; | ||
| 39 | |||
| 40 | |||
| 41 | sub epoch( $join = '', %opts ) { | ||
| 42 | join $join, Time::HiRes::gettimeofday; | ||
| 43 | } |