Update: Congrats on your homework score, and thanks for telling us up front. ;)
1. Don't use POD to store test data. Instead of =item test, consider putting test data under a __DATA__ token at the end of your sources. Or if you're disabling a section of code and want to use POD, use the proper POD tags to disable compilation. =item isn't always seen as a proper beginning of a POD chunk.
2. Completely optional, but I would put a call to exit() before you start defining subs. If I don't see one, I start looking for extra mainline code between and after all the subs.
3. Pick a capitalization style for subroutine identifiers, and stick with it. Your format_time is Perl standard, but CheckRanges is different.
4. Minor note about your #-- END foo sub-routine comments. If I can't see both the top of the sub and the bottom of the sub on a large screen (or with fewer than two page-ups on an average screen), it might be too long. Consider how the task can be naturally divided. These are short subs, and the indentation is mostly consistent, so I wouldn't bother with these closing comments.
5. Dennis and Kernighan (of C fame) fought this battle too, but consider putting a space after keywords like for (...) and return (...). If it doesn't have a space, it looks like a subroutine identifier, and for is not a function.
Check perlstyle for more general Perl style ideas.
--
[ e d @ h a l l e y . c c ]
In reply to Re: Style and Coding Criticism (part 2)
by halley
in thread Style and Coding Criticism (part 2)
by inelukii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |