Keep It Simple, Stupid | |
PerlMonks |
Re: How do you Test that the right output got printed?by mrborisguy (Hermit) |
on Jul 27, 2005 at 18:18 UTC ( [id://478692]=note: print w/replies, xml ) | Need Help?? |
Like jeffa said, you want status to return a value instead of printing. This not only makes it better for testing, but it's better OO practice in general. What if some time along the line, somebody wants to subclass your class, and wants to know the status. You're forcing them to print it out, but if you just return a value, then it's useable to them. Also it's not too much difficult, and more clear, to write:
-Bryan
In Section
Seekers of Perl Wisdom
|
|