CTKlib
view release on metacpan or search on metacpan
1.06 Fri Yan 04 16:07:59 2013 GMT
* Documentation modified
* CTK::Util: Modified functions scandirs, scanfiles and ls
1.07 Tue Jan 8 17:06:49 2013 GMT
* Documentation modified
* CTK::Util - Added subroutines: getsyscfg, prefixdir, localstatedir,
sysconfdir, srvdir, sharedir, docdir, localedir, cachedir, syslogdir,
spooldir, rundir, lockdir, sharedstatedir, webdir and randchars
1.08 Tue Jan 29 12:31:22 2013 GMT
* Documentation modified
* CTK::Util: Modified all extended subroutines.
See http://www.pathname.com/fhs/pub/ for details
* CTK::Util: Added shuffle function from List::Util::PP module
* CTK::Util: Added eqtime function from ExtUtils::Command module
* Added interactive mode in bin/ctklib helper script
lib/CTK/Util.pm view on Meta::CPAN
Tags: BASE, UTIL
=head3 lf_normalize, nl_normalize
my $normalized_string = lf_normalize( $string );
Returns CR/LF normalized string
Tags: BASE, FORMAT
=head3 localedir
my $value = localedir();
For example value can be set as: /usr/share/locale
See L<Sys::Path/"localedir">
Tags: CORE, BASE, FILE
=head3 localstatedir
my $value = localstatedir();
For example value can be set as: /var
/var - $Config::Config{'prefix'}
lib/CTK/Util.pm view on Meta::CPAN
L</"randchars">,
L</"randomize">,
L</"shuffle">
=item B<:CORE>
Exports functions:
L</"cachedir">,
L</"docdir">,
L</"localedir">,
L</"localstatedir">,
L</"lockdir">,
L</"prefixdir">,
L</"rundir">,
L</"sharedir">,
L</"sharedstatedir">,
L</"spooldir">,
L</"srvdir">,
L</"sysconfdir">,
L</"syslogdir">,
lib/CTK/Util.pm view on Meta::CPAN
# cluck -- as extended warn
# confess -- as extended die
use base qw /Exporter/;
my @est_api = qw(
read_attributes
syscfg getsyscfg isos isostype
);
my @est_core = qw(
prefixdir localstatedir sysconfdir srvdir
sharedir docdir localedir cachedir syslogdir spooldir rundir lockdir sharedstatedir webdir
);
my @est_util = qw(
randomize randchars shuffle isTrueFlag isFalseFlag
);
my @est_encoding = qw(
to_utf8 to_windows1251 to_cp1251 to_base64 from_utf8
);
my @est_format = qw(
escape unescape slash tag tag_create cdata dformat fformat
lf_normalize nl_normalize file_lf_normalize file_nl_normalize
lib/CTK/Util.pm view on Meta::CPAN
}
return @arr if $wh;
return undef;
}
sub where { which(shift,1) }
#
# See Sys::Path
#
# prefixdir localstatedir sysconfdir srvdir
# sharedir docdir localedir cachedir syslogdir spooldir rundir lockdir sharedstatedir webdir
#
sub prefixdir {
my $pfx = __PACKAGE__->ext_syscfg('prefix') ;
return defined $pfx ? $pfx : '';
}
sub localstatedir {
my $pfx = prefixdir();
if ($pfx eq '/usr') {
return '/var';
} elsif ($pfx eq '/usr/local') {
lib/CTK/Util.pm view on Meta::CPAN
return '/srv';
}
return catdir($pfx, 'srv');
}
sub webdir {
my $pfx = prefixdir();
return $pfx eq '/usr' ? '/var/www' : catdir($pfx, 'www');
}
sub sharedir { catdir(prefixdir(), 'share') }
sub docdir { catdir(prefixdir(), 'share', 'doc') }
sub localedir { catdir(prefixdir(), 'share', 'locale') }
sub cachedir { catdir(localstatedir(), 'cache') }
sub syslogdir { catdir(localstatedir(), 'log') }
sub spooldir { catdir(localstatedir(), 'spool') }
sub rundir { catdir(localstatedir(), 'run') }
sub lockdir { catdir(localstatedir(), 'lock') }
sub sharedstatedir { catdir(localstatedir(), 'lib') }
#
# Sys core utils
#
( run in 1.138 second using v1.01-cache-2.11-cpan-ceb78f64989 )