# New Ticket Created by Nathan Glenn # Please include the string: [perl #122975] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=122975 > I want to retrieve the mode that a handle was opened in via B, but the values of "append" and "read and write" are mutually exclusive, so information is lost if a handle is opened with both and then inspected via B. To demonstrate: use strict; use warnings; use B; use File::Temp; my $temp_fh = File::Temp->new(); $temp_fh->close(); my $filename = $temp_fh->filename; foreach my $mode (qw( < > >> +< +> +>> )) { open(my $fh, $mode, $filename) || die "Can't open temp file in mode $mode: $!"; my $type = B::svref_2object($fh)->IO->IoTYPE(); print "$mode -- $type\n"; } The above prints the below: < -- < > -- > >> -- a +< -- + +> -- + +>> -- a These all make sense except for the last one, which should be "a+" or something.