in reply to Re^2: Using the perl debugger to look at a renaming files function
in thread Using the perl debugger to look at a renaming files function

Let's consider this. I know that we're encouraged to come up with an SSCCE, but this is not, nor can it easily be made so. It's an html templating system that has evolved according to my needs.

Your questions were not about HTML templating systems, they were about manipulating lists of filenames. It would have been easy enough for you to construct an SSCCE which demonstrated a single, isolated problem. If your SSCCE did not exhibit the same problem as your larger code then the problem is somewhere else in your larger code and you need to determine that first.

Question: what use statements can be removed from everything I've posted?

Let's just look at this one package. You have use 5.010; and  use 5.011; in package utils1; - the former is quite obviously superfluous and should be removed (it does nothing and if read in isolation is potentially misleading).

In some of the subroutines you use strict, in others warnings and in still others both (or neither). This inconsistency is perplexing to say the least. Far better to use both throughout: either within your package or in the scope enclosing it.

In subroutine invert_aoa you use 5.010; but there is apparently nothing in this sub which requires that version. What is the statement doing here? Remove this.

In subroutine highest_number you use both File::Basename and Cwd but then do absolutely nothing with them. Remove these.

In subroutines print_aoa and print_hash you use 5.011; but there is apparently nothing in these subs which requires that version. What is the statement doing here? Remove this.

Other things which aren't helping you: inconsistent indenting, use of the special variables $a and $b as lexicals, using a package name with all lowercase when it isn't a pragma and exporting everything.

If you had created an SSCCE then it is probable that some or perhaps even all of these issues would not appear in it. That would make the work of everyone reading the SSCCE much easier and therefore make them (ie. me) much more likely to offer help. There are therefore 2 benefits. Firstly the construction of the SSCCE helps you to hone down the problem better and in doing so may even solve it for you. Secondly, it allows others to see the actual problem you are having without wading through hundreds of lines of unnecessary code.


🦛