Acrux
view release on metacpan or search on metacpan
lib/Acme/Crux.pm view on Meta::CPAN
unless (defined($logfile) && length($logfile)) {
$self->{logfile} = File::Spec->catfile(IS_ROOT ? $logdir : $pwd, sprintf("%s.log", $moniker));
}
# PID file
my $pidfile = $self->{pidfile};
unless (defined($pidfile) && length($pidfile)) {
$self->{pidfile} = File::Spec->catfile(IS_ROOT ? $rundir : $pwd, sprintf("%s.pid", $moniker));
}
# Define plugins list to plugin map
$self->plugins(as_hash_ref($args->{plugins}));
# Preloading plugins
my $preload_plugins = $self->{preload_plugins};
$preload_plugins = [$preload_plugins] unless is_array_ref($preload_plugins);
my $pplgns = words(@$preload_plugins);
$self->plugin($_) for @$pplgns;
#foreach my $p (@$preload_plugins) {
# next unless defined($p) && is_value($p);
# $self->plugin($_) for split(/[\s;,]+/, $p);
lib/Acrux/Const.pm view on Meta::CPAN
);
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
our @EXPORT = (
@{$EXPORT_TAGS{GENERAL}},
);
# Other items we are prepared to export if requested
our @EXPORT_OK = (
map {@{$_}} values %EXPORT_TAGS
);
# Correct tags: makes lowercase tags as aliases of original uppercase tags
foreach my $k (keys %EXPORT_TAGS) {
next if exists $EXPORT_TAGS{(lc($k))};
$EXPORT_TAGS{(lc($k))} = $EXPORT_TAGS{$k} if $k =~ /^[A-Z_]+$/;
}
#
# Filesystem Hierarchy Standard
lib/Acrux/Util.pm view on Meta::CPAN
my $new_midle = $marker x $dots; # Middle part of string
my $new_end = substr($string, (length($string) - $fix), $fix); # Last part of string
$new_end =~ s/^\s+//; # trim
return sprintf ("%s%s%s", $new_start, $new_midle, $new_end);
}
sub indent {
my $str = shift // '';
my $ind = floor(shift || 0);
my $chr = shift // ' ';
return $str unless $ind && $ind <= 65535;
return join '', map { ($chr x $ind) . $_ . "\n" } split /\n/, $str;
}
sub words {
my @in;
foreach my $r (@_) {
if (ref($r) eq 'ARRAY') { push @in, @$r } else { push @in, $r }
}
my %o;
my $i = 0;
foreach my $s (@in) {
$s = trim($s // '');
( run in 0.256 second using v1.01-cache-2.11-cpan-65fba6d93b7 )