While I haven't tested this in detail, it would seem to me that your usage of while (<T>) in load_tbls is clobbering $_, which is aliased to an entry in @database. Thus, when the while loop exits, $_ is undefined (the exit condition).
In reply to Re: use of $_ is destroying @database ... why?
by premchai21
in thread use of $_ is destroying @database ... why?
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |