Your buildArray subroutine won't work correctly because as perlsyn explains:
If any part of LIST is an array, "foreach" will get very confused if you add or remove elements within the loop body, for example with "splice". So don't do that.
In reply to Re: How to reference to array keys?
by jwkrahn
in thread How to reference to array keys?
by mmartin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |