Help for this page

Select Code to Download


  1. or download this
    my $content;
    tie *STDOUT, 'IO::Scalar', \$content;
    do $file;
    untie *STDOUT;
    return $content;
    
  2. or download this
    tie(*CAPTURE, 'IO::Scalar', \$content);
    select(CAPTURE);
    $| = 1;
    ...
    select(STDOUT);
    untie(*CAPTURE);
    return $content;