use strict; use warnings; use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); my $file_name='/tmp/test_me.txt'; open my $fh,'>',$file_name || die "can't open $file_name for writing: $!\n"; my $flags=fcntl $fh,F_GETFL,O_NONBLOCK || die "fcntl call failed: $!\n"; print "Flags: $flags\n"; close $fh || die "can't close write handle to $file_name: $!\n"; #### my $flags=fcntl(FH,F_GETFL,$_) || die "fcntl call failed: $!\n";