You should consider the fact that 'grep' creates a temporary data structure and that Perl's garbage collection probably won't release it back to the OS (from my experience).
Please consider a simpler way to do what you ask without consuming exessive memory -
Note that you can use the same loop for adding more restrictions or perform more actions if you need, which may save you run-time in some cases.foreach (keys %$a){ !/le/ and $c->{$_} = $a->{$_}; }
Enjoy,
Mickey
In reply to Re: create hash using grep
by mickeyn
in thread create hash using grep
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |