XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
There is very little scoping used here. The @IDsLens array is very large and is apparently only used to construct the hash. Why? I can't see that this is necessary but even if you think that it is, the scope should be limited to this construction phase. I would be inclined to refactor the code into subs. It would make the purpose clearer, help to enforce some scoping and allow for better profiling. While it probably won't affect the RAM footprint, your code is verbose to the extent that it becomes harder to read, not easier. In the construction loop, for example you have this:
which could equally be written as
While the way you have written it will work, it takes longer and more effort for the programmer to read and parse (and wonder why there is an elsif in there). I hope these tips are of some use to you. In reply to Re: Reduce RAM required
by hippo
|
|