in reply to Re^2: Adding items to arrays: best approach?
in thread Adding items to arrays: best approach?
This is indeed a purely stylistic concern. Personally, when a line needs to be split around a binary operator I would split after the operator as I think this reinforces the point that the statement isn't finished once the end of the line has been reached. I do this in any language, not just Perl. It was probably taught to me decades ago as a minor technique in aiding clarity and has stayed with me ever since.
With postfix control operators (if, unless, for etc.) it's the other way round as they are more tightly bound to the subsequent clauses (again, subjective). So I might write:
print 'Very looooooooooooooooooooooooooooooooooooooooooooooooooooooooo +ooooong non-interpolated string costing $many ', "and another clause from prog $0\n"; # but die 'Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +ooooooong exception message' if $OMG_ZOMBIES > $max_zombies_allowable;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Adding items to arrays: best approach?
by jcb (Parson) on May 29, 2020 at 00:09 UTC |