WWW::Mechanize::Script::Util - some basic utility functions for scripts
version 0.101
This module doesn't export anything by default, but any of the following on request:
opt_required_all
opt_required_one
opt_exclusive
load_config
find_scripts
Fails by invoking pod2usage when none of the options in @opt_names are given in %opt_hash.
Fails by invoking pod2usage when any of the options in @opt_names are missing in %opt_hash.
Fails by invoking pod2usage when more than one of the options in @opt_names are given in %opt_hash.
Tries to load the primary configuration. It looks in any directory returned by "config_dirs" in File::ConfigDir for files named either check_web or like the basename of the invoking script ($0) with any extension supported by Config::Any. The found configuration files are merged into a single configuration hash using Hash::Merge with the LEFT_PRECEDENT ruleset.
$0
When an option hash is given, the default agent is computed based on the value of $opt_hash{file}.
Finds scripts based on configuration and given patterns.
When %cfg contains an array with full qualified path names below the script_dirs, those directories are scanned. When the directories are relative, the are concatenated using "config_dirs" in File::ConfigDir (each entry in the script_dirs is evaluated separately).
%cfg
When %cfg contains a string below the key script_dirs, the config_dirs($cfg{script_dirs}) is used to find the scripts.
In any other case, config_dirs("check_web") is used.
The @patterns list must contain one or more file names or expandable shell patterns with or without directory parts and/or extensions.
@patterns
Valid entries are for example:
qw(check_host_app_one)
qw(check_host/app_one)
qw(check_host_app_one.json)
qw(check_host/app_one.yml)
qw(check_splunk_[1-5])
qw(splunk/test*)
Returns the list of found script file names.
Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Mechanize-Script or by email to bug-www-mechanize-script@rt.cpan.org.
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Jens Rehsack <rehsack@cpan.org>
This software is copyright (c) 2014 by Jens Rehsack.
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 WWW::Mechanize::Script, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mechanize::Script
CPAN shell
perl -MCPAN -e shell install WWW::Mechanize::Script
For more information on module installation, please visit the detailed CPAN module installation guide.