Ok i'd love to, except there's about 500,000 lines of code previously written by someone else. (badly). Trust me this is not the way i'd normal write things but am forced to..
Unfortunately whoever wrote this previously was terrible and it's just easier to keep running along thier lines, the reasons i'm asking the questions is i would never write a program like this but have to as small additions are being made.
I.e. everywhere through the code it has $Sel1Ttl + $Sel2Ttl......$Sel80Ttl already written..
Now everyone in thier answers has concentrated on the addition of the values, where the real problem is the $SelMaking this number changeTtl part...
| [reply] |
I guess some heavy refactoring is needed then. Should not be that hard to search&replace all the /\$Sel(\d+)Ttl\b/ with "$SelTtl\[$1]". Of course you should then go and replace those insane $Sel1Ttl + $Sel2Ttl......$Sel80Ttl, by sum(@SetTtl) (from List::Util), but that's something that can wait if necessary.
Jenda
We'd like to help you learn to help yourself
Look around you, all you see are sympathetic eyes
Stroll around the grounds until you feel at home
-- P. Simon in Mrs. Robinson |
| [reply] [d/l] [select] |
except there's about 500,000 lines of code
In a single script? Assuming an average length of 40 Bytes per line that would be 19 MB!
| [reply] |