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 reply to Re: To read files from two dir by graff
in thread To read files from two dir by pragovnj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.