App-ConMenu
view release on metacpan or search on metacpan
$menu->waitForInput();
1;
# DESCRIPTION
App::ConMenu is a very simple console menu application it allows you to display a menu of
choices then select one of those by pressing the corresponding number. This will cause ComMenu
to execute the associated commands in the menu.yml file.
The `m.pl` in the scripts dir is a script that creates a menu by using the module. By default
the script uses ~/.con\_menu.yml on unix type systems and <HOMEDIR>\\\_con\_menu.yml on Windows type systems. If
the files do not exist then you will be prompted to create an example version.
# LICENSE
Copyright (C) Michael Mueller.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
# AUTHOR
lib/App/ConMenu.pm view on Meta::CPAN
1;
=head1 DESCRIPTION
App::ConMenu is a very simple console menu application it allows you to display a menu of
choices then select one of those by pressing the corresponding number. This will cause ComMenu
to execute the associated commands in the menu.yml file.
The C<m.pl> in the scripts dir is a script that creates a menu by using the module. By default
the script uses ~/.con_menu.yml on unix type systems and <HOMEDIR>\_con_menu.yml on Windows type systems. If
the files do not exist then you will be prompted to create an example version.
=head1 LICENSE
Copyright (C) Michael Mueller.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 AUTHOR
scripts/m.pl view on Meta::CPAN
#!/usr/bin/perl
# A simple menu script
# By default the script uses ~/.con_menu.yml on unix type systems and <HOMEDIR>\_con_menu.yml
# on Windows type systems. If the files do not exist then you will be prompted to create an
# example version.
use strict;
use warnings;
use 5.10.0;
use File::HomeDir;
use File::Spec;
use Carp qw (croak);
use lib './lib/';
use App::ConMenu;
my $menu = App::ConMenu->new();
my $homeDir = File::HomeDir->my_home;
my $filePrefix = '.'; #.filename for unix type systems
if ($^O eq 'MSWin32') {
$filePrefix = '_'; # _filename for windows.
}
my $fullFileName = File::Spec->catfile($homeDir, $filePrefix.'con_menu.yml') ;
#offer to create a default file
if (! -e $fullFileName ) {
say 'The Yaml menu file does not exist in your home dir. ';
say 'Would you like me to create it ? (Y/N)';
my $selection = <>;
( run in 2.330 seconds using v1.01-cache-2.11-cpan-64ef6c95b5d )