The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Term::Menu::Hierarchical - Perl extension for creating hierarchical menus

SYNOPSIS

DESCRIPTION

This module only exports a single method, 'menu', which takes an arbitrary-depth hashref as an argument. The keys at every level are used as menu entries; the values, whenever they're reached via the menu, are displayed in a pager. Many text files (e.g., recipe lists, phone books, etc.) are easily parsed and the result structured as a hashref; this module makes displaying that kind of content into a simple, self-contained process.

The module itself is pure Perl and has no system dependencies; however, terminal handling always involves a pact with the Devil and arcane rituals involving chicken entrails and moon-lit oak groves. Users are explicitly warned to beware.

Bug reports as well as results of tests on OSes other than Linux are always eagerly welcomed.

Features:

For those who want to display data beyond plain old ASCII, Term::Menu::Hierarchical expects UTF8-encoded text. Please don't disappoint it, and it won't (shouldn't) disappoint you. Perhaps the most common/easiest solution (assuming that your data is already UTF8-encoded) is to push the ':utf8' PerlIO layer onto the filehandle you want to read from:

    open my $fh, '<:utf8', $filename or die ...

Or, for filehandles that are already open, just use 'binmode':

    binmode $fh, ':utf8';

For a full treatment of the topic, see perldoc perlunicode.

EXPORT

menu

        Takes a single argument, a hashref of arbitrary depth. See the included test scripts for usage examples.
      

SEE ALSO

Term::Cap, Term::ReadKey, perl

AUTHOR

Ben Okopnik, <ben@okopnik.com>

COPYRIGHT AND LICENSE

Copyright (C) 2010 by Ben Okopnik

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.