Help for this page

Select Code to Download


  1. or download this
    die "Ouch. $!" unless open my $fh, '>', 'foo.txt';
    print {$fh;} "hi!\n";
    close $fh;
    
  2. or download this
    Note that if you're storing FILEHANDLEs in an array,
    or if you're using any other expression more complex
    ...
    
        print { $files[$i] } "stuff\n";
        print { $OK ? STDOUT : STDERR } "stuff\n";