# Test Perl6::Form -- submitting code for Perl Monks # zero-padded fields appears to be broken # Declarative width fields appears to calculate the field length # incorrectly use strict; use warnings; use diagnostics; use Perl6::Form; my $columns = 44; my $fID = "TEST"; my $tID = "003 "; my $space = " "; my $fPer = "Test"; my $tPer = "100.0"; my $fVal = "Int for Zero Pad"; my $tVal = "3"; my $fFlo = "Float for Zero Pad"; my $tFlo = 3.2; # Produces error for invalid field length print "Length = " . length($tID) . "\n"; print form { page => { width => ($columns + 1), } }, "{<<{15}<<}|{>(5)>}|{><}|{<<{15}<<}|{>(5)>}%|", $fID, $tID, $space, $fPer, $tPer; # When above is commented out print form is commented out # Produces Use of uninitialized value $whole in pattern match (m//) print form { page => { width => ($columns + 1), } }, "{<<{20}<<}{0>>>>>}", $fVal, $tVal, "{<<{20}<<}{0>>>.>>0}", $fFlo, $tFlo;