sub tie_session { my ($hash) = @_; eval { tie %$hash, 'Apache::Session::File', undef, { Directory => $r->dir_config('Blah'), LockDirectory => $r->dir_config('Blah'), }; }; return $@ if $@; return $hash; # not actually necessary, but it returns true }