in reply to Inherited a perl script...need help

The way this script is currently written seems to be very dangerous. You have a lot of columns in each row and by processing the entire row with a global modifier it means every data point is being parsed with the exact same rules, regardless of what the data actually is (for instance, you apply the same manipulation rule for an ID as you do for a specific school code).

Splitting the data and processing each column with its own specific ruleset is slower, but there is much less risk of stomping on a good value that you don't want to change.

  • Comment on Re: Inherited a perl script...need help

Replies are listed 'Best First'.
Re^2: Inherited a perl script...need help
by afoken (Chancellor) on Nov 12, 2015 at 07:14 UTC

    Additional hint: Text::CSV_XS can handle all splitting and joining of the data lines. With some SQL knowledge, DBI and DBD::CSV may be helpful, even if they add some overhead.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)