in reply to using fetchall_arrayref in popupmenu
It used the first line because that's what you gave it. The arrayref returned from (presumably DBI) is an arrayref with each row being an arrayref containing one row of the data. So you need to create an arrayref with one row containing all your data items. One way to do it would be to make a hash slice in your fetchall_arrayref call, then you can pass either the keys or values list to popupmenu.
Alternatively, you can build a new arrayref that holds only the values in the first column, something like this:
my @tmp=map { $_->[0] } @$res;
which is roughly the same as:
my @tmp=(); push @tmp, $_->[0] for @$res;
The first one, though can be used in a single line with the popupmenu call:
popupmenu(-values=>[ map { $_->[0] } @$res ]);
Note: I didn't test any of this, so you'll have to fix any syntax errors I made.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|