You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Migrated from rt.perl.org#122975 (status was 'new')
Searchable as RT122975$
The text was updated successfully, but these errors were encountered: