<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME

    CTK - Command-line ToolKit library (CTKlib)

VERSION

    Version 2.03

NOTE

    The 2.00+ versions of this library is not compatible with earlier
    versions

SYNOPSIS

        use CTK;
    
        my $ctk = new CTK;
        my $ctk = new CTK (
            project =&gt; 'MyApp',
            configfile  =&gt; '/path/to/conf/file.conf',
            logfile     =&gt; '/path/to/log/file.log',
        );

DESCRIPTION

    CTKlib - is library that provides "extended-features" (utilities) for
    your robots written on Perl. Most of the functions and methods this
    module written very simple language and easy to understand. To work
    with CTKlib, you just need to start using it!

 new

        my $ctk = new CTK;
        my $ctk = new CTK (
            project =&gt; 'MyApp',
            configfile  =&gt; '/path/to/conf/file.conf',
            logfile     =&gt; '/path/to/log/file.log',
        );

    Main constructor. All the params are optional

    configfile

          configfile =&gt; '/etc/myapp/myapp.conf'

      Path to the configuration file of the your project

      Default: /etc/&lt;PREFIX&gt;/&lt;PREFIX&gt;.conf

    datadir

          datadir =&gt; '/path/to/your/data/dir'

      Directory for application data storing

      Default: &lt;getcwd()&gt; (current directory)

    debug

          debug =&gt; 1
          debug =&gt; 'on'
          debug =&gt; 'yes'

      Debug mode

      Default: 0

    ident

          ident =&gt; "test"

      Ident string for logs and debugging

      Default: ""

    log

          log =&gt; 1
          log =&gt; 'on'
          log =&gt; 'yes'

      Log mode

      Default: 0

    logdir

          logdir =&gt; '/var/log/myapp'

      Log directory of project

      Default: /var/log/&lt;PREFIX&gt;

    logfile

          logfile =&gt; '/var/log/myapp/myapp.log'

      Full path to the log file

      Default: /var/log/&lt;PREFIX&gt;/&lt;PREFIX&gt;.log

    options

          options =&gt; {foo =&gt; 'bar'}

      Command-line options, hash-ref structure. See Getopt::Long

      Default: {}

    plugins

          plugins =&gt; [qw/ test /]
          plugins =&gt; "test"

      Array ref of plugin list or plugin name as scalar:

      Default: []

    prefix

          prefix =&gt; "myapp"

      Prefix of the Your project

      Default: lc(&lt;PROJECT&gt;)

    project

          project =&gt; "MyApp"
          name =&gt; "MyApp"

      Project name

      Default: $FindBin::Script without file extension

    root

          root =&gt; "/etc/myapp"

      Root dir of project

      Default: /etc/&lt;PREFIX&gt;

    suffix

          suffix =&gt; "devel"
          suffix =&gt; "alpha"
          suffix =&gt; "beta"
          suffix =&gt; ".dev"

      Suffix of the your project. Can use in plugins

      Default: ""

    tempdir

          tempdir =&gt; "/tmp/myapp"

      Temp directory of project

      Default: /tmp/&lt;PREFIX&gt;

    tempfile

          tempfile =&gt; "/tmp/myapp/myapp.tmp"

      Temp file of project

      Default: /tmp/&lt;PREFIX&gt;/&lt;PREFIX&gt;.tmp

    test

          test =&gt; 1
          test =&gt; 'on'
          test =&gt; 'yes'

      Test mode

      Default: 0

    verbose

          verbose =&gt; 1
          verbose =&gt; 'on'
          verbose =&gt; 'yes'

      Verbose mode

      Default: 0

 again

    For internal use only (plugins). Please not call this function

 configfile

        my $configfile = $ctk-&gt;configfile;
        $ctk-&gt;configfile("/path/to/config/file.conf");

    Gets and sets configfile value

 datadir

        my $datadir = $ctk-&gt;datadir;
        $ctk-&gt;datadir("/path/to/data/dir");

    Gets and sets datadir value

 debug

        $ctk-&gt;debug( "Message" );

    Prints debug information on STDOUT if is set debug mode. Also sends
    message to log if log mode is enabled

 debugmode

        $ctk-&gt;debugmode;

    Returns debug flag. 1 - on, 0 - off

 error

        my $error = $ctk-&gt;error;

    Returns error string if occurred any errors while creating the object

        $ctk-&gt;error("error text");

    Sets new error message and returns it. Also prints message on STDERR if
    is set debug mode and sends message to log if log mode is enabled

 exedir

        my $exedir = $ctk-&gt;exedir;

    Gets exedir value

 load

        $ctk-&gt;load("My::Foo::Package");

    Internal method for loading modules.

    Returns loading status: 0 - was not loaded; 1 - was loaded

 load_plugins

        my $summary_status = $self-&gt;load_plugins( @plugins );

    Loads list of plugins and returns summary status

 logdir

        my $logdir = $ctk-&gt;logdir;
        $ctk-&gt;logdir("/path/to/log/dir");

    Gets and sets logdir value

 logfile

        my $logfile = $ctk-&gt;logfile;
        $ctk-&gt;logfile("/path/to/log/file.log");

    Gets and sets logfile value

 logmode

        $ctk-&gt;logmode;

    Returns log flag. 1 - on, 0 - off

 origin

        my $args = $ctk-&gt;origin();

    Returns hash-ref structure to all origin arguments

 option

        my $value = $ctk-&gt;option("key");

    Returns option value by key

        my $options = $ctk-&gt;option;

    Returns hash-ref structure to all options

    See "options"

 project, prefix, suffix

        my $project_name = $ctk-&gt;projtct;
        my $prefix = $ctk-&gt;prefix;
        my $suffix = $ctk-&gt;suffix;

    Returns project, prefix and suffix values

 revision

        my $revision = $ctk-&gt;revision;

    Returns revision value

 root

        my $my_root = $ctk-&gt;root; # /etc/&lt;PREFIX&gt;

    Gets my root dir value

 silentmode

        $ctk-&gt;silentmode;

    Returns the verbose flag in the opposite value. 0 - verbose, 1 -
    silent.

    See "verbosemode"

 status

        my $status = $ctk-&gt;status;

    Returns boolean status of creating and using the object

        my $status = $ctk-&gt;status( 1 );

    Sets new status and just returns it

 tempfile

        my $tempfile = $ctk-&gt;tempfile;
        $ctk-&gt;tempfile("/path/to/temp/file.tmp");

    Gets and sets tempfile value

 tempdir

        my $tempdir = $ctk-&gt;tempdir;
        $ctk-&gt;tempdir("/path/to/temp/dir");

    Gets and sets tempdir value

 testmode

        $ctk-&gt;testmode;

    Returns test flag. 1 - on, 0 - off

 tms

        print $ctk-&gt;tms; # +0.0080 sec

    Returns formatted timestamp

        print $ctk-&gt;tms(1); # 0.008000

    Returns NOT formatted timestamp

 verbosemode

        $ctk-&gt;verbosemode;

    Returns verbose flag. 1 - on, 0 - off

    See "silentmode"

VARIABLES

        use CTK qw/ WIN NULL TONULL ERR2OUT PREFIX /;
        use CTK qw/ :constants /

    ERR2OUT

      Returns string:

          2&gt;&amp;1

    NULL

      Returns NULL device path or name for Windows platforms

    %PLUGIN_ALIAS_MAP

      This hash is using for sets aliases of plugins, e.g.:

          use CTK qw/ %PLUGIN_ALIAS_MAP /;
          $PLUGIN_ALIAS_MAP{myplugin} = "My::Custom::Plugin::Module";

    PREFIX

      Return default prefix: ctk

    TONULL

      Returns string:

          &gt;/dev/null 2&gt;&amp;1

    WIN

      Returns 1 if Windows platform

TAGS

    :constants

      Will be exported following variables:

          WIN, NULL, TONULL, ERR2OUT, PREFIX

    :variables

      Will be exported following variables:

          %PLUGIN_ALIAS_MAP

HISTORY

    1.00 / 18.06.2012

      Init version

    2.00 Mon Apr 29 10:36:06 MSK 2019

      New edition of the library

    See Changes file

DEPENDENCIES

    Class::C3::Adopt::NEXT, Config::General, DBI, ExtUtils::MakeMaker,
    File::Copy, File::Path, File::Pid, File::Spec, File::Temp, IO,
    IO::String, IPC::Open3, JSON, List::Util, MIME::Base64, MIME::Lite,
    MRO::Compat, Net::FTP, Perl::OSType, Sys::SigAction, Sys::Syslog
    Term::ANSIColor, Test::Simple, Text::SimpleTable, Time::HiRes,
    Time::Local, Try::Tiny, URI, XML::Simple, YAML::XS

TO DO

    See TODO file

BUGS

    * none noted

SEE ALSO

    perl

AUTHOR

    SerÅ¼ Minus (Sergey Lepenkov) http://www.serzik.com &lt;abalama@cpan.org&gt;

COPYRIGHT

    Copyright (C) 1998-2019 D&amp;D Corporation. All Rights Reserved

LICENSE

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

    See LICENSE file and https://dev.perl.org/licenses

</pre></body></html>