There's more than one way to do things | |
PerlMonks |
Re: To read files from two dirby graff (Chancellor) |
on Apr 12, 2022 at 03:00 UTC ( [id://11142927]=note: print w/replies, xml ) | Need Help?? |
I know what it's like to "inherit" old code that needs updating so it can handle new conditions. And when I see error messages (like the ones you showed in your first reply to GrandFather) referring to "line 1601" and "line 1657", this tells me that the old code probably needs to be split up into smaller pieces so that it can be maintained more easily -- i.e. a relatively small "main" (executable) script that takes command-line parameters, and one or more modules containing subroutines that are used by the main script.
Reorganizing the code that way can be a lot of work, but it'll generally be worth the effort. Apart from that... Do you still have the original version of the script, which presumably worked at some point in the past (and would work again if the directories and files were set up they way they used to be)? If so, check the differences between that original version and the modified version that causes the errors. The problem might be something simple, like adding declarations for variables that are being reported as not declared. It won't do you much good to post thousands of lines of messy old code here, so don't do that. See if you can work out for yourself what the original script was doing -- write this out as a sequence of fairly simple step-by-step sentences. Then work out how that differs from what the new version needs to do. Figure out the lines of code that handle each sentence/step, and arrange each set of lines so that you can treat it as a subroutine. (Did the original script use subroutines? Do those make sense to you?) Once you have an organized relation between the steps and the groups of lines that implement those steps, you'll be able to focus attention on one relatively small chunk at a time, and if you still need help, it'll be easier to show us just the part that's causing trouble. Good luck.
In Section
Seekers of Perl Wisdom
|
|