use Fcntl qw(F_GETFL O_APPEND); sub is_append { my $fh = shift; my $status = fcntl($fh, F_GETFL, 0); return $status & O_APPEND; }