I cant figure out why this would cause the problem.
I think you're mistaking '' as being synonymous with () when initializing an array, when what you're really doing is setting the first element to be an empty string (ie, my @dirs = ( '' );), making @dirs non-empty but giving you the appearance of nothingness as you iterate over @dirs (at least once, anyway).
You might also want to read undef'ing @arrays caveat which covered a very similar issue.
--k.
In reply to Re: Array contents vanishing...why is this???
by Kanji
in thread Array contents vanishing...why is this???
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |