> > sub some_run_mode > > { > > # eventually > > # $self->append_content('...'); > > $self->run_mode('named_run_mode'); > > return; > > }
> I don't see an advantage over: > return $self->named_run_mode() I've missed the beginning of this discussion, so just tell me to shut up if I'm off track here. I often alter run_mode in setup() after I sanity check input (they called run mode "Bar", which also expects a valid search term. Their search term is invalid, so I'll set the run_mode to "Foo". One case that happens often is when I use "friendly" URLs: index.cgi?129 In this case, it will do one thing if input is given, or something else if no imput is given. I can't rely on the 'rm' param in this case, so I have setup() do some checks and set the run_mode. If setup is doing it, It would be wrong to return $self->named_run_mode; > If you have the run-mode name in a variable you can do: > my $run_mode = "foo"; > return $self->$run_mode(); > > And the code will call foo(). Isn't Perl great? Isn't that a soft reference that: 1) Makes strict angry 2) Is discouraged, because 90% of soft-references should be hash elements? --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]