in reply to Problems returning values from a db and putting into a hash

You loop through the keys of %dados, implicitly placing each key in the variable $_. But instead of using these keys, you keep using $fil to display the results in your foreach loop. This is what you get when you use global variables.

A quick fix might be to change the loop to this, locally setting $fil to each successive key:

foreach my $fil (keys (%dados))