> > The following pices of code do not work: > > ----------------------------------------------------- > code sample 1 > -------------- > > 1. sub handler { > 2. my $r = instance Apache::Request(shift); > 3. > 4. $r->dir_config(MyVar => undef); > 5. > 6. $r->dir_config->unset("MyVar"); > 7. > 8. $r->dir_config->set(MyVar => undef); > 9. > 10. } > > > None of lines 4, 6 or 8 actually unset the variable.
did you try $r->server->dir_config->unset("MyVar") as well? the dir_config table is a bit strange, since it merges per-server and per-directory configurations at runtime - from what I remember when playing with this last time, if you remove it from the per-dir config but you set it on a per-server config (which sounds like what you are doing) it will be perpetually re-populated on access to the per-dir config. so, you may need to wipe both dir_config tables clean in order to really unset the variable from your handler. HTH --Geoff