Yes, i think there is some kind of bug in there, either a documentation bug, or implementation bug, or both
perl6form doesn't have an INTeger field, so {0>>>>>} doesn't mean zero pad (that is only documented for decimal numbers ie floats)
Also, zero padding numeric fields only shows using {]].[[} not {>>.<<} so that could be a doc bug or implementation bug (not implemented, or error not detected)
So to fill that integer field with zeros you have to use lfill right before the value ... this works
#!/usr/bin/perl --
use strict;
use warnings;
use diagnostics;
use Perl6::Form qw/ form /;
print form
{ page => { width => ( 44 + 1), } },
"{<<{20}<<}|{>>>>>}",
"Int for Zero Pad", {lfill => '0',} , 3 ,
"{<<{20}<<}|{]]].[[}",
"Float for Zero Pad", 3.2,
"{<<{20}<<}|{]]].[[0}",
"Float for Zero Pad", 3.2,
"{<<{20}<<}|{0]]].[[0}",
"Float for Zero Pad", 3.2,
;;;;;
__END__
Int for Zero Pad |0000003
Float for Zero Pad | 3.2
Float for Zero Pad | 3.2000
Float for Zero Pad |00003.2000
So maybe the implementation is incomplete, doesn't do the padding, or doesn't warn about invalid field pattern .... good job finding this AnaximanderThales
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.