in reply to Design Question
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(); ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Design Question
by Anonymous Monk on Aug 07, 2003 at 02:44 UTC | |
by sgifford (Prior) on Aug 07, 2003 at 03:09 UTC |