+ 'trim|length|l=s' => sub {
+ my ($optname, $optval) = @_;
+ $optval =~ s/%$// and $opt{trimpct}++;
+ $optval =~ m/^-?[0-9]+$/ or die(
+ "Value \"$optval\" invalid for option $optname",
+ " (number or percentage expected)\n"
+ );
+ $opt{trim} = $optval;
+ },