bcrowell2 has asked for the wisdom of the Perl Monks concerning the following question:

Howdy, all,

A user of an open-source project of mine reports that when he upgraded to Fedora 22, the following statement started causing an error:

use open ":encoding(utf8)";

He gets this:

$ perl use open ":encoding(utf8)"; Can't locate open.pm in @INC (you may need to install the open module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at - line 1. BEGIN failed--compilation aborted at - line 1.

Running perl --version shows that he's running perl 5.20.2. I'm running 5.18 and can't reproduce the error.

Is "use open" deprecated? I don't see any mention of it in the perldelta. Can anyone who's running perl 5.20 confirm whether or not this error occurs for them, either on Fedora or some other system?

Thanks in advance!

Replies are listed 'Best First'.
Re: "use open" fails in perl 5.20?
by ikegami (Patriarch) on Jun 11, 2015 at 18:33 UTC
    It has not been deprecated. It does come with 5.20 (and 5.22). Something's messed up with their Perl install. Perhaps their system vendor moved open.pm into a separate package they need to install?

        Yep, that's it. The user applied the patch and it fixed the problem.

        Thanks, all, for the help!

Re: "use open" fails in perl 5.20?
by dasgar (Priest) on Jun 11, 2015 at 17:57 UTC

    Using portable Strawberry Perl 5.20.2.1 (32-bit) on a Windows system, I was able to run the following without any issues.

    perl -e "use open \":encoding(utf8)\";"

    If it's not a Perl 5.20.2 issue, it could be that the person's path variables (@INC, etc.) may have gotten messed up during the OS upgrade.

Re: "use open" fails in perl 5.20? ( Can't locate open.pm means "use open" worked )
by Anonymous Monk on Jun 12, 2015 at 00:41 UTC
    Can't locate open.pm means "use open" worked, it did its job, it couldn't find the module, and its letting you know, it worked