in reply to Search for abcNUMBERdef, make it a variable, then do math?
As a best practice, you should waste no time or processor cycles before you put the results of the captures stored in $1 and its brethren into regular variables. Never ever trust them to "keep" their values. A subroutine far far away in another module my decide at any moment to trash them for its own use.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Search for abcNUMBERdef, make it a variable, then do math?
by AnomalousMonk (Archbishop) on Jan 22, 2011 at 09:16 UTC |