und
- Hash mit validen Parametern umbenannt
- exists statt trueish
- "die" statt "croak"
);
# valid parameters -> better as class members with rose generic set/get
-my %params = (
- fromdate => '',
- todate => '',
+my %valid_params = (
+ from_date => '',
+ to_date => '',
customernumbers => '',
part_id => '',
rounding => 1,
# check user input param names
foreach my $param (keys %{ $data }) {
- croak "Not a valid key: $param" unless $params{$param};
+ die "Not a valid parameter: $param" unless exists $valid_params{$param};
}
# TODO check user input param values - (defaults are assigned later)