in reply to Re: Data type validation using regular expressions
in thread Data type validation using regular expressions
(my $spec_file = shift) or die $syntax; (my $data_in_file = shift) or die $syntax; (my $data_out_file = shift) or die $syntax; # etc...
Yuk!
die $syntax unless @ARGV == 5; my ($spec_file, $data_in_file, $data_out_file, $log_file, $max_errors) + = @ARGV;
or
my ($spec_file, $data_in_file, $data_out_file, $log_file, $max_errors) + = @ARGV; die $syntax unless defined $max_errors;
Do not repeat yourself!
|
|---|