Help for this page

Select Code to Download


  1. or download this
    use strict; use warnings;
    BEGIN { require Capture::Tiny; }
    my $out = Capture::Tiny::capture { print "STDOUT output to capture"; }
    +;
    print "Captured STDOUT: [" . ( defined $out ? $out : 'undef' ) ."]\n";
    
  2. or download this
    Captured STDOUT: [STDOUT output to capture]
    
  3. or download this
    use strict; use warnings;
    require Capture::Tiny;
    my $out = Capture::Tiny::capture { print "STDOUT output to capture"; }
    +;
    print "Captured STDOUT: [" . ( defined $out ? $out : 'undef' ) ."]\n";
    
  4. or download this
    Can't call method "Capture::Tiny::capture" without a package or object
    + reference at C:\@local\@projects\@tests\test-Capture-Tiny.pl line 5.