Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^6: Perl6::Form Issues with Zero-Padding and Declarative Width (integer)

by AnaximanderThales (Novice)
on Nov 18, 2014 at 23:07 UTC ( [id://1107664]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Perl6::Form Issues with Zero-Padding and Declarative Width (integer)
in thread Perl6::Form Issues with Zero-Padding and Declarative Width

I believe it makes sense now.

{>(20)>} generates an error because it's not {>>>>>>>>>(20)>>>>>>>>>}?

{>>>(7)>>} doesn't generate an error?

The Parens'd value is a validity of the bracketed field as opposed to the value that will be presented at run time? Am I correct?

  • Comment on Re^6: Perl6::Form Issues with Zero-Padding and Declarative Width (integer)

Replies are listed 'Best First'.
Re^7: Perl6::Form Issues with Zero-Padding and Declarative Width (integer)
by Loops (Curate) on Nov 18, 2014 at 23:17 UTC

    Well, you could easily test that theory yourself. ;o) But unfortunately no. You must not insert the (7) into the format, you must overwrite existing characters instead.

    Step 1: Write the format you want.

    {>>>>>}

    Step 2: Force Perl6::Form to validate the format length at runtime.

    {>(7)>}

    In both cases above the string length is identical before and after the addition of this validation number.

    And really, most of the time you should just skip step 2. It doesn't buy you much. You can check these things with a decent text editor. As the author said, it was primarily meant for use by automated tools.

      I am a step closer on it, though! When I get home, I'll play around with it extensively. I'm still at work and have homework to tend to. I'll check in when I think I can explain it to someone with no background in it.

      Truly appreciate the time.

      Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1107664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found