Subject: | Using &selected(]Selected[) does not always work |
Distribution: Term-Menus-1.31
Perl Version: v5.8.8
OS: Linux localhost 2.6.18.8.tex5 #1 SMP Thu May 10 11:36:58 WST 2007
i686 Intel(R) Pentium(R) M processor 1600MHz GNU/Linux
Using &selected(]Selected[) does not always work, it prints 0 instead
e.g. selecting option 10 and 11.
$ cat /mnt/desktop/menu.pl
use Term::Menus;
sub selected { print "\n SELECTED ITEM = $_[0]\n" }
my %Menu_1=(
Label => 'Menu_1',
Item_1 => {
Text => "/bin/Utility - ]Convey[",
Convey => [ `ls -1 /bin` ],
Result => "&selected(]Selected[)",
},
Select => 'One',
Banner => "\n Choose a /bin Utility :"
);
my @selections=&Menu(\%Menu_1);
print "SELECTIONS=@selections\n";
$ perl /mnt/desktop/menu.pl
Choose a /bin Utility :
1. /bin/Utility - arch
2. /bin/Utility - ash
3. /bin/Utility - awk
4. /bin/Utility - basename
5. /bin/Utility - bash
6. /bin/Utility - bash3
7. /bin/Utility - bsh
8. /bin/Utility - cat
9. /bin/Utility - chgrp
10. /bin/Utility - chmod
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE: 1
SELECTED ITEM = arch
SELECTIONS=DONE_SUB HASH(0x804cd08) HASH(0x804c09c) HASH(0x807e228)
HASH(0x807e240) HASH(0x807e258) HASH(0x807e288)
$ perl /mnt/desktop/menu.pl
Choose a /bin Utility :
1. /bin/Utility - arch
2. /bin/Utility - ash
3. /bin/Utility - awk
4. /bin/Utility - basename
5. /bin/Utility - bash
6. /bin/Utility - bash3
7. /bin/Utility - bsh
8. /bin/Utility - cat
9. /bin/Utility - chgrp
10. /bin/Utility - chmod
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE: 10
SELECTED ITEM = 0
SELECTIONS=DONE_SUB HASH(0x804cd08) HASH(0x804c09c) HASH(0x807e228)
HASH(0x807e240) HASH(0x807e258) HASH(0x807e288)
$ perl /mnt/desktop/menu.pl
Choose a /bin Utility :
1. /bin/Utility - arch
2. /bin/Utility - ash
3. /bin/Utility - awk
4. /bin/Utility - basename
5. /bin/Utility - bash
6. /bin/Utility - bash3
7. /bin/Utility - bsh
8. /bin/Utility - cat
9. /bin/Utility - chgrp
10. /bin/Utility - chmod
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE:
Choose a /bin Utility :
11. /bin/Utility - chown
12. /bin/Utility - consolechars
13. /bin/Utility - cp
14. /bin/Utility - cpio
15. /bin/Utility - cut
16. /bin/Utility - date
17. /bin/Utility - dd
18. /bin/Utility - df
19. /bin/Utility - dmesg
20. /bin/Utility - dnsdomainname
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE: 11
SELECTED ITEM = 0
SELECTIONS=DONE_SUB HASH(0x804cd08) HASH(0x804c09c) HASH(0x807e228)
HASH(0x807e240) HASH(0x807e258) HASH(0x807e288)
$ perl /mnt/desktop/menu.pl
Choose a /bin Utility :
1. /bin/Utility - arch
2. /bin/Utility - ash
3. /bin/Utility - awk
4. /bin/Utility - basename
5. /bin/Utility - bash
6. /bin/Utility - bash3
7. /bin/Utility - bsh
8. /bin/Utility - cat
9. /bin/Utility - chgrp
10. /bin/Utility - chmod
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE:
Choose a /bin Utility :
11. /bin/Utility - chown
12. /bin/Utility - consolechars
13. /bin/Utility - cp
14. /bin/Utility - cpio
15. /bin/Utility - cut
16. /bin/Utility - date
17. /bin/Utility - dd
18. /bin/Utility - df
19. /bin/Utility - dmesg
20. /bin/Utility - dnsdomainname
104 Total Choices
Press ENTER (or "d") to scroll downward
OR "u" to scroll upward (Press "q" to quit)
PLEASE ENTER A CHOICE: 12
SELECTED ITEM = consolechars
SELECTIONS=DONE_SUB HASH(0x804cd08) HASH(0x804c09c) HASH(0x807e228)
HASH(0x807e240) HASH(0x807e258) HASH(0x807e288)