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?

con
  • 5,767
  • 8
  • 33
  • 62
  • What shell are you using? Try to set `SHELL` explicitly like this: `curl -L https://install.perlbrew.pl | SHELL=/bin/bash bash`. – Håkon Hægland May 19 '22 at 15:15
  • @HåkonHægland I am using bash, the command that you wrote did not work :( – con May 19 '22 at 15:16
  • No idea why, but the errors are the result of this failing: `my $executable = $0; open my $fh, "<", $executable;` – ikegami May 19 '22 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 May 19 '22 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 May 19 '22 at 17:09

1 Answers1

2

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

sudo cpan App::perlbrew
perlbrew init
ikegami
  • 367,544
  • 15
  • 269
  • 518
con
  • 5,767
  • 8
  • 33
  • 62