in reply to Very very small style question
My personal view is the "if @ >=3" if preferable to the "unless" option. We are wanting to do something if there are still some paramaters to process - so write it that way. Whether the ">2" or ">=3" is better, well, that to me is personal choice. However, the ">2" option is the minimalist solution - we don't care how many paramaters there are, as long as there is at least one more.
The second issue is the one Merlyn raised - what is the most desirable to make processing decisions on subroutine paramaters? Merlyn's way - doing a shift on @_ and processing each paramater in turn is probably the safest way. Each paramater has its processing "self containted" - that is, you are not relying on its position in the @_ array, or the total number of arguments, or other potential time bombs.
|
|---|