in reply to Re^9: Common Perl Pitfalls
in thread Common Perl Pitfalls
But if done right it's 1 compilation versus 12 compilations and 20 stringifications over the whole runtime of the script! According to the first of your benchmarks about 1 millisecond of difference. Huge deal indeed!
If your regexes grow way too big, do whatever you must. Under normal conditions the difference in negligible, while the fact that I don't have to worry whether I'm writing a regexp or a single quoted string that will eventually happen to be part of a regexp is not. Even though or rather just because the difference is slight and changes the behaviour rarely.
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Common Perl Pitfalls
by JavaFan (Canon) on Apr 11, 2012 at 23:36 UTC |