From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

# -*- Mode: Perl; -*-
use strict;
$^W = 1;
print "1..2\n";
print "ok 1\n";
my $hidden_form_in = qq{<INPUT TYPE="TEXT" NAME="foo1" value="nada">
<input type="hidden" name="foo2"/>};
my %fdat = (foo1 => 'bar1',
foo2 => '"bar2"');
my $fif = new HTML::FillInForm;
my $output = $fif->fill(scalarref => \$hidden_form_in,
fdat => \%fdat);
if ($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="hidden"|name="foo2"|value="&quot;bar2&quot;")){3} \/>$/){
print "ok 2\n";
} else {
print "Got unexpected out for $hidden_form_in:\n$output\n";
print "not ok 2\n";
}