RT_Config.pm.in: PriorityAsString clarity for perl noobs #354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.