in reply to Re: The -w switch on a web application
in thread The -w switch on a web application

Depends on which of these is realistically going to make a difference. I'd write something like this:
my $main_menu = Menu->new("main"); my $active_menu_id = get_active_menu(param('menu_item')||''); $main_menu->active_menu_id($active_menu_id) if defined $active_menu_id; $main_menu->output;

The distinction between the user selecting no menu item or submitting an invalid selection is not likely to matter, so I just default that case to a defined but invalid value. Whether or not he has select a valid menu item however definitely is important, so I check that case appropriately.

Btw, indirect object syntax looks neat but has a bunch of caveats. Use the arrow notation instead.

Makeshifts last the longest.