Subject: | Wish stash places in $r were intialized by Maypole |
You know how you say things like:
@{$r->objects || []} and
$r->{template_args}{beerme} = 'hoppy'; # soon to be deprecated
because you are worried that the array ref of hash ref in the objects acessor or template_args accessor has not been initialized yet ?
Well that gets old does'nt it. It also sucks when you say:
$r->stash->{last_beer} = $beer ;
and get a "Can't use undefined value as hashref" error. because this is the first thing you are putting in the stash.
I think slots in the Maypole object that are documented or understood(will be documented) to be of a particular type of reference, should be intialized to that type as early as possible.
It will make things so much nicer. Things that fall under this are:
$r->
objects
params
template_args
stash (in svn)
query
Thanks,
Peter