Help for this page
die "Ouch. $!" unless open my $fh, '>', 'foo.txt'; print {$fh;} "hi!\n"; close $fh;
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";