[tapx-dev] [186] ** make stdout catchable **

Eric Wilhelm scratchcomputing at gmail.com
Mon Jul 16 09:07:08 BST 2007


# from ewilhelm at hexten.net
# on Monday 16 July 2007 01:03 am:

The only reason I didn't do this as a filehandle is that I wasn't sure 
how the setup/init code fits together.  Should probably just be

  print $self->{stdout} @_;

It does really cleanup my ugly cargo-culted test code though.

> sub output {
>     my $self = shift;
>-    print @_;
>+    if(my $out = $self->stdout) {
>+        $$out .= $_ for(@_); # XXX what's $\ here?
>+    }
>+    else {
>+        print @_;
>+    }
> }

--Eric
-- 
Hot dogs:  just another condiment.
--Heart-attack Man
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------


More information about the tapx-dev mailing list