Knowing when to call clear_big_array is harder.use vars qw($big_array); sub get_big_array { if (!$big_array) { $big_array = [ ... construct big array... ]; } return $big_array; } sub clear_big_array { undef $big_array; } sub processA { common_stuff($_); # special stuff } sub processB { loop (1..1000) { common_stuff($_); # special stuff } } sub common_stuff { my $ba = get_big_array(); ... }
In reply to Re: Design Question
by sgifford
in thread Design Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |