App-Basis
view release on metacpan or search on metacpan
bin/appbasis view on Meta::CPAN
the same terms as the Perl 5 programming language system itself.
=cut
__END__
|#!/usr/bin/env perl
|# PODNAME: %%APPNAME%% - simple script to ...
|# ABSTRACT: Create a boilerplate app for App::Basis
|
|=head1 NAME
|
|%%APPNAME%%
|
|=head1 SYNOPSIS
|
| > %%APPNAME%% ..options..
|
| to get full help use
| > %%APPNAME%% --help
|
|=head1 DESCRIPTION
|
|Description of what your application does
|
|=cut
#
# (c) yourname, your@email.address.com
# this code is released under the Perl Artistic License
use 5.10.0 ;
use strict;
use warnings;
use App::Basis;
use App::Basis::Config ;
# -----------------------------------------------------------------------------
# main
my $program = get_program();
my %opt = init_app(
help_text => "Boiler plate code for an App::Basis app",
help_cmdline => "extra commandline args",
options => {
'verbose|v' => 'Dump extra useful information',
'test=s' => {
desc => 'test item',
# depends => 'item',
default => 'testing 123',
# required => 1,
},
'item=s' => {
# required => 1,
default => '123',
desc => 'another item',
# validate => sub { my $val = shift ; return $val eq 'item'}
}
},
#log_file => "your-logfile",
);
# debug will go into "~/$program.log" by default
# lets have the config named after this program
my $cfg = App::Basis::Config->new( filename => "~/.$program" ) ;
# example of using an app specifc config
my $user = $cfg->get('/appbasis/name') ;
my $pass = $cfg->get('/appbasis/password') ;
if ( $opt{verbose} ) {
debug( "INFO", "Started");
}
( run in 3.126 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )