rt icon indicating copy to clipboard operation
rt copied to clipboard

RT_Config.pm.in: PriorityAsString clarity for perl noobs

Open NReilingh opened this issue 1 year ago • 1 comments

For your consideration:

Speaking from the perspective of someone who has not been hacking with perl for decades, I was recently trying to configure this setting in RT5's web interface, and had to do a bit of head-scratching. One change here is reordering HashRef and ArrayRef to match the code example, though perhaps it is preferred to reorder the code example instead of the text - either way, they should be consistent for people who are not familiar with the terminology.

The other change is to express the ArrayRef with commas instead of fat arrows. In RT5's web interface, these kinds of values are provided as JSON which is then deserialized/reserialized into Perl's object syntax, but from looking at the fat arrows in the ArrayRef example, it's not necessarily obvious that the JSON serialization of this is just going to be an array of scalars. I tried both "General": [ {"Medium": 50}, {"Low": 0} ] and "General": [ {"Medium": 50, "Low": 0} ] before I remembered that => is equivalent to , and should try a regular array.

Not the first time I've been confused by this while working with RT5's web configuration... but I'm getting better. Still I think it would be worthwhile to think about helping non-perl-native admins translate the perl syntax to JSON.

NReilingh avatar Feb 10 '23 05:02 NReilingh