unify var substitution in locationRules and exportedHeaders
When compiling locationRules, exportedHeaders and postDatas, words beginning with $ are supposed to be session data and substituted: for example, exportedHeader "foo" is compiled as "
datas->{foo}".
There are two exceptions in locationRules:
- $date is replaced with localtime
- $vhost is replaced with request hostname
and one in exportedHeaders:
- $ip is replaced with remote IP
I think these exceptions should be applied to all perl expression, i.e. locationRules, exportedHeaders and postData ;
Besides, special vars as $_ and $1 are substituted the same way. So one can't use grep and map in these perl expressions, and one has to hack to get regexp captures. I think we can assume that no LL::NG administrator will define session vars '$_' and '$2', so we should not substitute these vars.