{ my @bigarray = ("insert", "a very", "long list here"); # c sub mySub { for (@bigarray){ # do stuff with array } } }
This keeps @bigarray private to the subroutine but only initializes it once. You get the best of both worlds at no added cost!
-sam
In reply to Re: Re: Re: scoping large arrays - newbie Q
by samtregar
in thread scoping large arrays - newbie Q
by moof1138
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |