A more comprehensive example script is provided with the distribution as a test script to verify the correct installation of the module; it also serves as a demonstration of all the features provided by the module. This demonstration script can be found in the installation directory; it will not be installed to your system during installation of the module.
In the following script, elements presented in bold are functions or variables provided by Cmenu, elements in italics are items provided by the user, all other text are generic perl instructions.
1 | #!/usr/bin/perl | |
2 | ||
3 | # Sample Cmenu script | |
4 | ||
5 | menu_initialise("Cmenu Sample Script"); | |
6 | ||
7 | menu_init("Menu Title","Menu Help Text"); | |
8 | ||
9 | menu_item("Option 1","gimme1"); | |
10 | menu_item("Option 2","gimme2"); | |
11 | ||
12 | chop($sel ![]() |
|
13 | ||
14 | menu_terminate("bye bye"); | |
15 |