in reply to How do i determine which mode the file has open ? (write or append mode)

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