Help for this page

Select Code to Download


  1. or download this
    use IO::Scalar;
    my $capture;
    tie(*CAPTURE, 'IO::Scalar', \$capture);
    select (CAPTURE);
    
  2. or download this
    local *CAPTURE;
    my $cmd = join " ", "perl", "script_name", @args);
    open (CAPTURE,  "$cmd |") or die "Cannot run command $cmd: $!";
    
  3. or download this
    my $file = "foo.txt";