On Tue, 10 Feb 2004 00:57, Orton, Yves wrote;

  > Its worth noting that this approach wont actually grab everything
  > on the tied filehandles.  There are enough ways to bypass the tie
  > that you have to do a lot more than that to get the majority, and
  > even then there is stuff that will still bypass it.

Yes, that is worth noting; but I'd consider all code that bypasses the
tie to be bugs or an inappropriate test case :-).

I'm just a little curious about the ways that this could happen; see
if you can add to this list.

  a) something grabs the file handle number via fileno(STDOUT) - or
     has a hardcoded `1' for STDOUT - and prints to that directly
     using stdio (now, wouldn't that have to be XS code?)

  b) something uses syswrite(STDOUT)

  c) something written via system("") prints to STDOUT

  d) something has already DUP'ed the file handle (ie open FOO,
     ">&STDOUT") and prints to it normally

  > Its very annoying actually that there isnt a reliable and clean
  > way to intercept STDOUT/STDERR properly. (IMO)

Other than fork and IPC, which bites and doesn't play well with the
test suites... try forking in the middle of a Test::Builder run.
-- 
Sam Vilain, sam /\T vilain |><>T net, PGP key ID: 0x05B52F13
(include my PGP key ID in personal replies to avoid spam filtering)

Activity is the politician's substitute for achievement.
 - anon.

Reply via email to