I have developed a small script based heavily on the demo script 'demo.menu' which comes with the Curses 1.06 module. However, as soon as I try to build any menus dynamically from an array I get weird results. The code below demonstrates the problem :-
However the menu which appears looks something like :-#!/usr/local/bin/perl use strict; use warnings; use Curses; my @test_array; push @test_array,"item 1|description 1"; push @test_array,"item 2|description 2"; my $count=0; foreach $record (@test_array) { split /\|/,$record; $item=new_item($_[0],$_[1]); push @il,$item; push @pack,${$item}; };
--------------------------- | ->item 2 description 2 | | item 2 description 2 | ---------------------------i.e. shows the 2nd (or last) item in the array twice. Can anybody explain why, or offer a better example script which makes use of the Curses module.
Many thanks
Myomancer
In reply to Curses curiosity by myomancer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |