in reply to Cleaning up Code

Before you do anything else add strictures (use strict; use warnings;) to your code. On the face of it all variables you are worried about except $row1 are local to the if block so their names don't matter. It may be there is a whole lot more context that is pertinent, but you haven't shown it.

Aside from that if (scalar@row1 == "6") is not right and doesn't make sense. It isn't right because == compares numbers, but "6" is a string. It doesn't make sense because there is not enough context to figure out where @row1 comes from and why it should have 6 elements. It needs to make sense before it can be refactored.


Perl's payment curve coincides with its learning curve.