NAME
Telegram::CamshotBot::Util - Reusable functions
VERSION
version 0.03
METHODS
random_caption
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"
]
random_caption
Return first file from array which exists
abs_path_of_sample_mojo_conf
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
first_existing_variable
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'
fev
Alias for first_existing_variable()
fef
Alias for first_existing_file()
AUTHOR
Pavel Serikov <pavelsr@cpan.org>
COPYRIGHT AND LICENSE
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.