David H. Adler wrote:




A question: is there any reason that you made this an OO module but
still show calls to the methods as functions rather than methods on the
object?


An answer: It was a quick hack based on my first day's experience with IO::Capture::Stdout. Its original rationale was simply to extend IO::Capture::Stdout in a test suite for a project on my day job.


I.e. why C<verify_number_lines($capture)> rather than
C<$capture->verify_number_lines> ? This would also remove the need to
explicitly export those functions.

I guess it would then be a subclass of IO::Capture::Stdout, since it would be adding new methods to those found in that module. That's a worthy objective, but to do it right would require that I actually *study* IO::Capture's code -- and then it would no longer have been a quick hack!


In any case, I put the summary up on the list and the code up on my own site mostly to generate discussion ... which seems to have occurred!

jimk

Reply via email to