Telegram::CamshotBot::Util - Reusable functions
version 0.01
Select a random element from array
Accepts ARRAYREF like
[ "Common sense is not so common", "Just do it", "We make porn here", "Learn by doing" ]
Return first file from array which exists
When packaging as module Mojolicious applications that use Mojolicious::Plugin::JSONConfig or Mojolicious::Plugin::Config it's needed to create a sample file inside of it
This function accepts package name and return abs_path of attached config file
Developer must place config file in same dir where main module located an call it same as *.pm file NAME
E.g. you have CamshotBot.pm so you must name config as CamshotBot.json.example
Return first existing non-empty variable or undef from given array
It's convenient to check ENV variables
Usage
first_existing_variable(undef, '', 'a')
will return 'a'
Alias for first_existing_variable()
Alias for first_existing_file()
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2017 by Pavel Serikov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Telegram::CamshotBot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Telegram::CamshotBot
CPAN shell
perl -MCPAN -e shell install Telegram::CamshotBot
For more information on module installation, please visit the detailed CPAN module installation guide.