Is it working?
Well, it is in production. :)
I have been tasked with fixing a number of reported bugs.
It qualifies as legacy code in that:
- It does not use strict or warnings.
- No unit tests.
- Hard to test in isolation. Not designed with testability in mind.
- No documentation.
- No coherent error handling policy.
- Lots of code duplication.
- Big-arse functions.
- Functions that are not cohesive (similar to a sin_and_tan() function).
- Inconsistent naming. Poorly chosen names.
- Lots of unnecessary cleverness.
- Code that does not match the comments.
- Pointless code (e.g. checks if running on Unix at runtime yet contains "use Win32::..." and so won't even compile on Unix).
- Constructor does not check validity of arguments.
- Module does not contain a version.
- Oh, and perl critic found a number of flaws such as: i) open calls not being checked; ii) $_ being modified in map and grep blocks; iii) capture variables being used without checking if regex succeeded.