we usually do this at the top of the packageuse constant {...};
so I wonder if there is an overhead for use constant?our $SKIPWORDS = {};
The thing I like about the inline/anon hashes is that all the logic and data is clearly seen in one place.
In this specific example, the package is 5000+ lines long, and the words() function because it starts with w... will end up near the end of the file - 5000 lines away from the skip and substitute words.
Will probably go with the use contant if there is no overhead - this func will get called a lot in an inner loop with anywhere up to a million times per run.
Thanks again, for the pointers,
Jeff
In reply to Re^2: Does Perl do constant anonymous hash creation optimisation?
by jaa
in thread Does Perl do constant anonymous hash creation optimisation?
by jaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |