[Rt-devel] Re: [Rt-commit] r7482 - in rt/branches/3.7-EXPERIMENTAL: .

Jesse Vincent jesse at bestpractical.com
Wed Apr 18 15:15:01 EDT 2007


Ruslan Zakirov wrote:
> RT->Config->Get returns different things in scalar and array contexts,
> for scalar options it's not that important, however for arrays and
> hash it's. Especially when you use (... xxx => RT->Config->Get, ...)
> as perl's '=>' op doesn't change context of the right hand argument to
> scalar.
> It's also important for options that have no default value(no default
> in etc/RT_Config.pm). If you don't force scalar context then you'll
> get empty list as result and all your named args will be messed up.
> For example (arg1 => 1, arg2 => RT->Config->Get('OptionDoesNotExist'),
> arg3 => 3) will result in (arg1, 1, arg2, arg3, 3). Or (arg1 => 1,
> arg2 => RT->Config->Get('ArrayOption'), arg3 => 3) will result in
> (arg1, 1, arg2, 'element of option', 'another_one'..., arg3, 3).
>
> In the case of the rtname option it's not important as it's mandatory
> and has default value in the config, so I can revert this change, it's
> sort of random change during debugging of a bug.
>
> Also, I can add extended description of Get with examples to the pod.
>
Both of those sound like good plans.





More information about the Rt-devel mailing list