bliako has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use FindBin; use File::Spec; my $whereami = $FindBin::Bin; use Test::More; #my $infile = 'config/ytmd.cfg'; # no problem #my $infile = File::Spec->catdir('config', 'abc.cfg'); # no problem my $infile = File::Spec->catdir($whereami, 'config', 'ytmd.cfg'); # pr +oblem open my $fh, '<:encoding(UTF-8)', $infile or die; close $fh; done_testing;
Doing a perl -T xx.pl or prove -T xx.pl (for the above script), it fails with this message Unknown PerlIO layer "encoding" at xx.pl line 14. which can be fixed with a use PerlIO::encoding; and it does not complain about what looks to me like tainted input.
However, if I remove use Test::More then the error becomes Insecure dependency in require while running with -T switch at xx.pl line 14. which is what i would expect. I am missing out something, for sure.
Perl v5.32 Test::More v1.302188 (latest)
bw, bliako
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unknown PerlIO layer "encoding" when it should fail because it's tainted
by choroba (Cardinal) on Feb 09, 2022 at 18:29 UTC | |
by bliako (Monsignor) on Feb 09, 2022 at 18:55 UTC | |
Re: Unknown PerlIO layer "encoding" when it should fail because it's tainted
by haj (Vicar) on Feb 09, 2022 at 21:15 UTC |
Back to
Seekers of Perl Wisdom