1

I'm attempting to install perlbrew via

\curl -L https://install.perlbrew.pl | bash

as suggested from https://perlbrew.pl

However, I get these errors

print() on closed filehandle $fh at perlbrew.Yyb5zU line 1569.
print() on closed filehandle $fh at perlbrew.Yyb5zU line 1569.
print() on closed filehandle $fh at perlbrew.Yyb5zU line 1569.

There are so many of those error lines, I can't even see anything else before them.

Fail to create /usr/local/perlbrew/etc/bashrc. Please check the permission of /usr/local/perlbrew/etc and try `perlbrew init` again. at perlbrew.Yyb5zU line 1462

I manually created directories in /usr/local/perlbrew, but this isn't a good idea, and it didn't fix the problem.

this is a redHat system, so I can't install via yum either.

How can I successfully install perlbrew on this redHat server?

5
  • What shell are you using? Try to set SHELL explicitly like this: curl -L https://install.perlbrew.pl | SHELL=/bin/bash bash. Commented May 19, 2022 at 15:15
  • @HåkonHægland I am using bash, the command that you wrote did not work :(
    – con
    Commented May 19, 2022 at 15:16
  • No idea why, but the errors are the result of this failing: my $executable = $0; open my $fh, "<", $executable;
    – ikegami
    Commented May 19, 2022 at 16:32
  • Maybe there's something special about the directory used during the installation. You could try ( export TMPDIR="$HOME/tmp"; mkdir -p "$TMPDIR"; \curl -L https://install.perlbrew.pl | bash )
    – ikegami
    Commented May 19, 2022 at 16:37
  • I dont think it is normal for perlbrew to touch files in system directories like /usr/local/. I remember that it normally works in ~/perl5/.
    – pii_ke
    Commented May 19, 2022 at 17:09

1 Answer 1

2

The installation page lists an alternate installation method which worked for me:

sudo cpan App::perlbrew
perlbrew init

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.