Help for this page

Select Code to Download


  1. or download this
    #! perl -slw
    use strict;
    ...
    tie *STDOUT, 'Filter::Handle', \*FH1, sub{ $_[0] };
    
    print 'Hello world!', $_ for 1 .. 10;
    
  2. or download this
    BEGIN{
        open FH1, '>', 'my.log' or die $!;
        *STDOUT = *FH1;
    }