CentOS 6 "Bareword found where operator expected"
threeiem opened this issue · 3 comments
When I run fresh on CentOS 6 servers I get this error:
$ ~/.fresh/source/freshshell/fresh/bin/fresh
Bareword found where operator expected at bin/fresh line 768, near "s/^\.//r"
I've tried running it several ways, but either way when I run bin/fresh bare it gives this error. I only see this issue on CentOS 6 and no issues on CentOS 7 and 8. This happens with a bare manual install with no other configurations in my .freshrc other than "fresh freshshell/fresh bin/fresh --bin"
CentOS: v6.10 (Final)
bash: v4.1.2
perl: v5.10.1
Since that looks like a syntax error I'd have to guess (uneducated) it's to do with the version of Perl. What versions of Perl are you using on CentOS 7 and 8?
For reference I'm using Perl v5.28.1.
I can reproduce this issue with the following:
docker run --rm centos:centos6 bash -c "yum -y update && yum -y install git && `curl -sL https://get.freshshell.com`"
A quick Google suggests that the r
modifier (perform non-destructive substitution and return the new value) was added in Perl v5.14¹.
I guess the question is: Do we make our code compatible with older versions of Perl or do we require >= 5.14? Doesn’t seem like it should be too hard to be compatible so I’m going to give that a whirl.
¹ https://stackoverflow.com/questions/30851957/version-dependent-fallback-code/30854733#30854733
Thanks for letting us know about this. Fixed by c270fab.