Alias.pm: Permission denied at /usr/lib64/perl5/Encode.pm line 47.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Alias.pm: Permission denied at /usr/lib64/perl5/Encode.pm line 47.
I'm trying to run the following perl script as a normal user:
Code:
#!/usr/bin/env perl
use open qw(:std :utf8);
use Encode qw(decode);
while (my $line = <STDIN>) {
print decode("MIME-Header", $line);
}
and I get the error(s):
Code:
Can't locate Encode/Alias.pm: /usr/local/lib64/perl5/Encode/Alias.pm: Permission denied at /usr/lib64/perl5/Encode.pm line 47.
BEGIN failed--compilation aborted at /usr/lib64/perl5/Encode.pm line 47.
Compilation failed in require at /user/mfoley/bin/decodeUTF8.pl line 3.
BEGIN failed--compilation aborted at /user/mfoley/bin/decodeUTF8.pl line 3.
There is, in fact, no file /usr/local/lib64/perl5/Encode/Alias.pm, but if I create a symlink (or hard link) from /usr/lib64/perl5/Encode/Alias.pm to /usr/local/lib64/perl5/Encode/Alias.pm I get the same "can't locate" error. Permissions are:
Code:
# ls -l /usr/local/lib64/perl5/Encode
total 24
-r--r--r-- 2 root root 12341 2016-04-30 00:42 Alias.pm
if I run perl script as root. It works.
I uninstalled all perl packages, both standard slackpkg (I'm running 14.2) and all SlackBuilds perl packages and reinstalled slackpkg perl and a few from SlackBuilds needed by spamassassin. That didn't help.
Your code compiles fine for me, which suggests the problem is your Perl installation.
If Encode.pm is in /usr/lib64/perl5/, then there should be a /usr/lib64/perl5/Encode directory containing Alias.pm and 28 other files and subdirectories. On my Fedora system (Perl v5.34.1), the directory has permissions
kjhambrick: I can run as normal user on Slackware 15, just not on 14.2.
Quote:
Originally Posted by smallpond
Your code compiles fine for me, which suggests the problem is your Perl installation.
If Encode.pm is in /usr/lib64/perl5/, then there should be a /usr/lib64/perl5/Encode directory containing Alias.pm and 28 other files and subdirectories. On my Fedora system (Perl v5.34.1), the directory has permissions
Code:
drwxr-xr-x. 1 root root 482 Jul 1 06:41 Encode
Yes, I have the /usr/lib64/perl5/Encode directory and it has 20 files and subdirectories (not counting the files in the subdirectories). My permissions on the Encode directory are the same as yours.
Quote:
Originally Posted by keefaz
Post output with
[code]
Running this as user, is there any permission error?
$ perl -e 'use Encode qw(decode);' && echo ok
Can't locate Encode/Alias.pm: /usr/local/lib64/perl5/Encode/Alias.pm: Permission denied at /usr/lib64/perl5/Encode.pm line 47.
BEGIN failed--compilation aborted at /usr/lib64/perl5/Encode.pm line 47.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Quote:
and
Code:
perl -e 'use Encode::Alias;' && echo ok
Code:
$ perl -e 'use Encode::Alias;' && echo ok
Can't locate Encode/Alias.pm: /usr/local/lib64/perl5/Encode/Alias.pm: Permission denied at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Do you have needed stuff in /usr/local/lib64/perl5? I would be tempted to delete all in this directory as it interferes with Slackware perl install
(see @INC, perl searches in /usr/local/lib64/perl5 first...)
See if this code works: (that removes /usr/local/... first entries in @INC)
Code:
perl -e ''BEGIN{splice @INC,0,2} use Encode qw(decode);' && echo ok
But as others have said, something seems broken with your perl installation.
Well, that's why I completely uninstalled the standard Slackware perl package and all perl programs from the SlackBuilds repository - then reinstalled from scratch.
Quote:
Originally Posted by keefaz
Do you have needed stuff in /usr/local/lib64/perl5? I would be tempted to delete all in this directory as it interferes with Slackware perl install
(see @INC, perl searches in /usr/local/lib64/perl5 first...)
See if this code works: (that removes /usr/local/... first entries in @INC)
Code:
perl -e ''BEGIN{splice @INC,0,2} use Encode qw(decode);' && echo ok
That code did run giving "ok" (once I removed the extra '), but my Perl script using Encode still gives the Permission denied error.
I did go ahead and delete /usr/local/lib64/perl5, but still the Permission denied error.
Does the error say something about /usr/local/share/perl5 ? If yes you will need to take care of this directory too...
As /usr/local/share/perl5 and /usr/local/lib64/perl5 are part of standard perl installation, you'll have to recreate them (if they don't exist anymore)
mkdir /usr/local/share/perl5 /usr/local/lib64/perl5
It's been a while on this thread. I forgot about it until I just now tried using the perl script today and realized I never got this fixed (Slackware 14.2). If y'all are still interested ...
Quote:
Originally Posted by henca
If so, it seems as if it hasn't even tried to find any Encode.pm.
Without any clue on what to search for, we might have to resort to the probably noisy result from:
Code:
strace -f perl -e 'use Encode::Alias;'
Yes, that returned 300+ lines. Probably too much
Quote:
If you think that gives too much noise you could try:
Code:
strace -f perl -e 'use Encode::Alias;' 2>&1 | grep stat
or
Code:
strace -f perl -e 'use Encode::Alias;' 2>&1 | grep open
regards Henrik
You 2nd suggestion returned something more reasonable:
Any CPAN flakiness going on under the user but not root? Check ~/.cpan/CPAN/MyConfig.pm and other CPAN related things. Old CPAN entries burned me more than once. Sometimes I've had to recompile modules with 'cpan -r'.
I have no ~/.cpan, but plenty of stuff in /root/.cpan; much of very old. Some perl stuff going back to 2012. I've tried uninstalling and reinstalling perl (see prior thread postings), but that did not good. Could I do something with cpan? How would I clear that out and start over? (if that would help)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.