1
votes

Doc states that expressions are equivalent:

use open ':locale';
use open IO => ':locale';

But why next are not?

use open ':utf8 :std';       # Unknown PerlIO layer class ':utf8 :std' (need IN, OUT or IO) at ...
use open IO => ':utf8 :std'; # No error happened
1
Both will fail on 5.18 and 5.26, though slightly differently. How old is this Perl? - Schwern
@Schwern: 5.24.1 - Eugen Konkov
@brian-d-foy: This question is not duplicate. This is about how to combine layers. That question you have linked is about which layers I should use. Both use similar expressions so questions are related, but actually are not duplicate. - Eugen Konkov

1 Answers

2
votes

Thank @Grinnz on IRC:

Because :std is not a layer, it must be its own argument in the list

So code should be:

use open ':utf8', ':std';