Search code examples
perllanguage-featureslexical-closures

What version of Perl introduced lexical my subroutines?


According to this bug report one of my modules is generating this error on older Perls,

Experimental "my" subs not enabled at <file.pm> ...

What should I set my minimum perl version too?


Solution

  • From perldoc perlexperiment

    Lexical subroutines

    • Introduced in Perl 5.18.0
    • Accepted in Perl 5.26.0