in reply to Re^6: CPAN module unit test issues: OS line endings (tar)
in thread CPAN module unit test issues: OS line endings

I'm not in the habit of submitting posts (correct or otherwise) to perlmonks that I believe to be inapplicable to the current thread

Unfortunately, my 2nd reply to you included "it [is] unlikely to apply in this situation", which is not correct. Sorry. What you describe is certainly a part of the process here. It was mostly that you replied to my question about why his code breaks in the face of certain line endings with a reply that had absolutely nothing to do with why his code cares about line endings.

I understand how CPAN practices make it easy for Unix line endings to end up in Windows text files. But I find Unix line endings in text files in Windows quite frequently anyway so I don't need any CPAN-specific reasons to motivate making Perl code not care about such, especially since his module surely needs to work on text files in Windows other than the ones that people download from CPAN.

And he had already gotten his code to work in the face of different line endings. I just felt that it was very likely that he was "doing it the hard way". So I was talking even more about how he should get his code to not care about line endings, which made talk of how which types of line endings come to be even further from that point.

So, to be clear, I am not questioning the validity of any of the information that you posted. I am not even questioning the appropriateness of where you posted it.

I just wanted to restate the kernel of my point in hopes of clarifying it and that it still stands, just because it wasn't obvious to me that this was clear to you or would be clear to readers of the thread.

Sorry about flubbing my 2nd attempt to clarify.

- tye        

  • Comment on Re^7: CPAN module unit test issues: OS line endings (topic)

Replies are listed 'Best First'.
Re^8: CPAN module unit test issues: OS line endings (topic)
by stevieb (Canon) on Sep 18, 2015 at 22:31 UTC

    tye, I just wanted to thank you for your direct criticism of the code you saw. When I set out to build this module, I wanted to test new things, but at the same time, ensure a flow that was single-path as much as possible, so I could collect and manage the data flowing through the chain at any point. It was, until I started peppering my code with Tie::File all over the place, which completely broke the flow.

    Right or wrong, what I've been doing today is rewriting all of the off-flow cases. The read/write of actual files happen now in a read sub and a write sub. There's only one place where each of these subs is called (from the single sub that interacts between the public methods and the core of the system upon entering and returning), so I've already found troubleshooting is much easier, as is making changes, validation, and handling line endings properly all in one place.

    I've always said since I started here at PM that "I am not a programmer", but even though we all feel a bit of shame when people point out our mistakes, I for one get past that and realize that those who reply actually care, and I for one definitely learn from it.

    Thanks again,

    -stevieb