Help for this page

Select Code to Download


  1. or download this
    sub foo {
        my $o = "";
    ...
    } else {
        print MYFILE foo();
    }
    
  2. or download this
    sub foo {
        print "blah\n";
    ...
    }
    foo();
    $OLDH and select $OLDH;
    
  3. or download this
    sub foo {
        my($O) = @_;
        print $O "blah\n";
    }
    foo($to_file ? *MYFILE : *STDOUT);
    
  4. or download this
    sub foo {
        my($P) = @_;
    ...
    }
    foo($to_file ? sub { print MYFILE @_ } : sub { print @_ });
    # or foo(sub { if ($to_file) { print MYFILE @_ } else { print @_ } });
    
  5. or download this
    our $O;
    sub foo {
    ...
    sub pri {
        if ($to_file) { print MYFILE @_ } else { print @_ }
    }