http://www.perlmonks.org?node_id=286884


in reply to Sub-initiate needs help getting started

Good luck, first of all.

There is a lot of good advice given so far about how to write better code than you've been given, but I'd be wary of making large structural changes given your deadline. It certainly needs it, but I doubt its feasible in the time frame.

So here is a quick and dirty approach:

Do the subs all look roughly the same - if you squint? It may be that there is just one main sub per report and some helper functions. Given that the code is so long, its probably not well structured and may be very repetitous. If the new reports you need to create are similar to the existing ones, you can just copy and paste one of the existings subs and make modifications until it works.

If the subs don't all look the same, and aren't 'one per report', this approach won't work at all.

Another possible route is to not change the existing code at all, but write any new report code from scratch. In the .pl file have a simple exit clause near the top so that if one of the new reports need to be processed, you use the new code, or else fall through to the original mess.

If the existing code is considered broken, this won't work.

Two more random points:

And again, good luck.

qq