=cut
###----------------------------------------------------------------###
-# Copyright 2006 - Paul Seamons #
+# Copyright 2007 - Paul Seamons #
# Distributed under the Perl Artistic License without warranty #
###----------------------------------------------------------------###
@UNSUPPORTED_BROWSERS
);
-$VERSION = '2.05';
+$VERSION = '2.08';
$DEFAULT_EXT = 'val';
$QR_EXTRA = qr/^(\w+_error|as_(array|string|hash)_\w+|no_\w+)/;
$value =~ s/\s+$//;
$modified = 1;
}
+ if ($field_val->{'trim_control_chars'}) {
+ $value =~ y/\t/ /;
+ $value =~ y/\x00-\x1F//d;
+ $modified = 1;
+ }
if ($field_val->{'to_upper_case'}) { # uppercase
$value = uc($value);
$modified = 1;
}
}else{
foreach my $value (@$values) {
+ next if ! defined $value;
$value =~ s{(?$opt:$pat)}{
my @match = (undef, $1, $2, $3, $4, $5, $6); # limit on the number of matches
my $copy = $swap;
{field => 'foo', do_not_trim => 1}
+=item C<trim_control_chars>
+
+Off by default. If set to true, removes characters in the
+\x00 to \x31 range (Tabs are translated to a single space).
+
+ {field => 'foo', trim_control_chars => 1}
+
=item C<replace>
Pass a swap pattern to change the actual value of the form.