Yes, there's $PerlIO::encoding::fallback
. You can assign the wanted “check” argument to that variable. When you then push a PerlIO layer onto a filehandle, the current value from that variable is saved for that layers failure behavior. E.g.:
use PerlIO::encoding;
use Encode;
# set a value
$PerlIO::encoding::fallback = Encode::FB_WARN;
# apply a layer under that value
open my $fh, '<:encoding(UTF-8)', $some_file or die ...;
# $PerlIO::encoding::fallback can be changed now