Yes, it works on the trivial example you used. It does not work with Perl.pm.

In reply to Re^4: Challenge: Capturing stdout from a function call. by BUU
in thread Challenge: Capturing stdout from a function call. by BUU

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