Don't ask to ask, just ask | |
PerlMonks |
Re: Scope and Contextby jynx (Priest) |
on Nov 14, 2001 at 06:29 UTC ( [id://125211]=note: print w/replies, xml ) | Need Help?? |
With salt firmly on tongue, For something that's not so obvious such as the fact that the map is being returned, it would seem better style to explicitly return it for clarity. The long route is to save the contents in an array and return the array. The short route is to tack a return statment on the fron of the map. Demonstrate: Which is clearer? You be the judge, you'll have to maintain it, but i generally go for no unnecessary temporary variables. Secondly, the bare _ in the filetest seems just fine since it's coupled with the other file test immediately. If you were doing filetests on the same filename but seperated (even if only be whitespace) it might be clearer to explicitly put in the filename (in this case $file). On the other hand, as said before, you're the one maintaining this, so if it's not clear to you, then it definitely won't be clear to the next guy (as a rule of thumb). jynx
In Section
Meditations
|
|