in reply to default values

I think something like:
$val = $default_val if $val eq '';
is easier to read and has the same effect as your code.
$val ||= $default_val;
Does not have the same effect as your code. It will set the default value if $val is false but not necessarily the empty string.
$default_val = "default"; $val = '0'; $val ||= $default_val; print $val;
will print default even though $val is not and empty string;

--

flounder