in reply to Designing a package object

Its a silly thing: your call to die is slurping all the args it is given: its as if you'd parenthesized all 5 args. Try using:

... || die("sorry,..."), _header => ...

--Dave

Replies are listed 'Best First'.
Re: Re: Designing a package object
by fuzzyping (Chaplain) on Jul 25, 2002 at 04:12 UTC
    Well, that solved a probable error, but it uncovered a more serious one. As I expected, there does indeed appear to be a problem with the passed hash. podmaster has mentioned (via CB) that this is probably the problem, and that I should pass a hashref instead, but I haven't figured that out just yet. Here's a new dump...
    [jason@lappy jason]$ perl test_menu.pl $VAR1 = bless( { '1' => undef, '2' => undef, '3' => undef, '_header' => 'Just testing...', '4' => undef, '_comment' => 'Ok, this is where the comment section +would normally go.', '_title' => 'Testing menu' }, 'Menu' );
    Update: Thanks to podmaster who pointed out that set_choices() should have {}'s in the HoH assignment, rather than ()'s. Thanks everyone!