Closed grtodd closed 9 years ago
I think that's going to be weird since fsinfo
will contain the captured stdout and stderr as well as the return value of the block.
The two examples are very different so I'm having trouble understanding what you're trying to achieve.
I don't think capture_chomp
makes sense because you're looking to chomp the results, not the captured output, which only makes sense if you're returning lines of text as the result. That's too much of a special case.
Sometimes I fool myself with github's UI into filing issues that really are more like mailing list discussions :-|
Anyway, my examples were a bit hastily cut and pasted - I'll change them so they are a bit more clear but will close this "issue". I agree: chomping lines of text is a special case even in my limited retinue of quick hacks :-) and local $/
map { chomp; $_ }
can handle this depending on whether you want a big long string or line by line array.
Capture::Tiny makes it so easy to grab the output from external commands in a readable way that I've become spoiled.
I'm always happy to have discussions with people using my code, so no worries. :-)
Thank you for Capture::Tiny.
When I don't want to chomp a capture:
.. when I do:
Is there a preferred way to
chomp
that could be documented with line or two of POD?I'm not qualified judge whether a function like
capture_chomp{ ... }
(i.e. if it saved more than a trivial number of characters or was safer/faster/more correct) would look silly on such a great module :-)Thanks again ++