1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/env perl use warnings; use strict; use 5.10.0; use Term::Choose::Util qw( change_config ); use Data::Dumper; my $menu = [ [ 'enable_logging', "- Enable logging", [ 'NO', 'YES' ] ], [ 'case_sensitive', "- Case sensitive", [ 'NO', 'YES' ] ], [ 'color' , "- Color of ... ", [ 'Red', 'Green', 'Blue' ] ], ]; my $config = { 'enable_logging' => 0, 'case_sensitive' => 1, 'color' => 2, }; change_config( $menu, $config, { in_place => 1 } ); say Dumper $config;