in reply to Re: creating 100 arrays
in thread creating 100 arrays

davido: I certainly agree with your points about arrays-of-arrays, hashes, etc., but if saurabh2k26 still wants to go the global variable route,  use vars ...; (see vars) is another way to create default-initialized arrays (and package – i.e., global – variables in general). (Non-default initialization must be done separately.) It also avoids generation of various pesky warnings down the line.

>perl -wMstrict -le "use constant AYCHES => 1 .. 100; use vars map '@H' . $_, AYCHES; ;; for(AYCHES) { no strict 'refs'; @{'H' . $_} = (0 .. $_); } ;; print qq{'$H50[50]' '$H100[-1]'}; " '50' '100'