in reply to push result into array

you probably have the arguments backward, check the docs. I assume you want to add @result onto @dept?
while (@result = $sth->fetchrow_array()) { push @dept,@result; }

__________
Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.