in reply to Unknown PerlIO layer "encoding" when it should fail because it's tainted
#!/usr/bin/perl -T use strict; use warnings; use FindBin; my $whereami = $FindBin::Bin; open my $fh, '<:encoding(UTF-8)', $whereami or die;
Note that untainting $whereami before opening the file prevents the error:
$whereami =~ /^(.*)$/ and $whereami = $1;
Interestingly, removing the :encoding prevents the error, too, without untainting, which seems wrong.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unknown PerlIO layer "encoding" when it should fail because it's tainted
by bliako (Abbot) on Feb 09, 2022 at 18:55 UTC |