=cut
###----------------------------------------------------------------###
-# Copyright 2006 - Paul Seamons #
+# Copyright 2007 - Paul Seamons #
# Distributed under the Perl Artistic License without warranty #
###----------------------------------------------------------------###
use base qw(Exporter);
BEGIN {
- $VERSION = '2.03';
+ $VERSION = '2.24';
@EXPORT = qw(form_fill);
@EXPORT_OK = qw(fill form_fill html_escape get_tagval_by_key swap_tagval_by_key);
};
### First pass
### swap <input > form elements if they have a name
$$ref =~ s{
- (<input \s (?: ([\"\'])(?:|.*?[^\\])\2 | [^>] )* >) # nested html ok
+ (<input \s (?: ([\"\'])(?:|.*?[^\\])\2 | [^>] )+ >) # nested html ok
}{
### get the type and name - intentionally exlude names with nested "'
my $tag = $1;
my $opts = substr($$ref, $start[$i], $close[$i] - $start[$i]);
$opts =~ s{
(<select \s # opening
- (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )* # nested html ok
+ (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )+ # nested html ok
>) # end of tag
}{}sxi || next;
next if ! $opts;
my $oldval = substr($$ref, $start[$i] + $offset, $close[$i] - $start[$i]);
$oldval =~ s{
(<textarea \s # opening
- (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )* # nested html ok
+ (?: "" | '' | ([\"\']).*?[^\\]\2 | [^>] )+ # nested html ok
>) # end of tag
}{}sxi || next;
my $tag = $1;
=head1 AUTHOR
-Paul Seamons
+Paul Seamons <perl at seamons dot com>
=cut