myomancer has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Curses curiosity
by Roger (Parson) on Nov 06, 2003 at 14:58 UTC | |
|
Re: Curses curiosity
by myomancer (Novice) on Nov 06, 2003 at 15:00 UTC | |
by Roger (Parson) on Nov 06, 2003 at 15:04 UTC |