Let me explain again: I am testing product code that is being written in python. The product outputs what it outputs, WITH the inconsistent indentation, and I do not control that. The String is to show the nature of the problem without having to discuss details of the product, which do not matter for this problem and solution. Because the YAML output is considered to be valid by yamlint, the people writing the product code do not consider their code to be broken. I need to write perl tests which extract data from the output, in order to make sure that the content of the output is correct. In order to do this, I need to parse the output WITH the inconsistent indentation, which yamlint can do. The YAML Loader in perl's YAML::Old cannot parse the output and considers the output to be invalid. I strongly suspect that some newer YAML Loaders for perl would parse the output just fine, but there are so many newer YAML Loaders, and I am not sure which are fully working and finished.

I guess I could blindly try whatever YAML Loaders for perl I can find until one of them works on this peculiarity, but since I expect to need to parse other YAML for these tests, with other peculiarities, I would rather choose the YAML Loader which is in the best shape, which I suspect means the Loader which is most compatible with the most recent or inclusive YAML spec.

So, which Loader do I want?

Am I making the problem clear yet?

As to why the python behaves as it does, I suspect that this has to do with how PyYAML works.


In reply to Re^4: python YAML output, perl Loader, which version? by mgwmgw
in thread python YAML output, perl Loader, which version? by mgwmgw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.