In the former case, you should be able to determine the type of the field from the table schema.
I could indeed do that (see below) but I was trying to simplify things. I tried INSERTing into the database without the quotes and it would not save the data. I do understand your point regarding Perl's handling of strings and numbers.