in reply to Making a Menu with a Database Query

There really isn't enough here to solve your problem, but I'll give you some pointers and maybe they'll be of use to you.

It looks like $item is a reference, based on your usage:

push @pack, ${$item};
Are you using item as a hard reference or a soft reference? If you don't know what I mean by this distinction, please read perlref. It is generally a bad idea to use soft references. Unless you thoroughly understand why you shouldn't use them, you shouldn't use them.

It also looks like you are using global variables for everything. I don't see any use of my, our or local. It is generally a good idea to use lexical variables as opposed to package globals. Using package globals sets you up for some very hard to track bugs. See Coping with Scoping and Use strict warnings and diagnostics or die for more info.

Try sticking some print or warn statements into your code at different spots. It is a very effective way to track down misbehaving variables. Or you can learn to use the perl debugger, but I've been too (short term) lazy to learn it, and just use prints.

Seeing some code for new_item may be helpful in diagnosing the problem.


TGI says moo