note
haukex
<blockquote><i>AFAIK, there is no way to pick the features enabled by -E automatically other than by using it.</i></blockquote>
<p>Well, <c>-E</c> is [https://github.com/Perl/perl5/blob/756f0910f/toke.c#L8796|equivalent] to a <tt>use feature ':5.<i>XX</i>';</tt>, so one slightly hackish way to get the same effect is <c>use feature ":5.".(0+substr($],2,3));</c>.</p>
<p><b>Update:</b> Crossposting the following better solution from [id://11136456|my other node] for completeness:</p>
<c>
use Config;
use feature ":$Config{PERL_REVISION}.$Config{PERL_VERSION}";
</c>
11136455
11136460