Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: To read files from two dir

by graff (Chancellor)
on Apr 12, 2022 at 03:00 UTC ( [id://11142927]=note: print w/replies, xml ) Need Help??


in reply to To read files from two dir

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11142927]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found