in reply to Scalar evaluation

"" is defined, the only value that isn't defined is undef.

So, if you remove the whole defined() ? : checking in get_my_params(), and just assing the param() values to the array elements your code should work.

update: unless you actually get an empty string as input (as you would, when you have html textfields), in that case it's probably better to check for $input eq ''