Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`and` and `or` precedence in Perl

Open Beginner friendly
#982 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
perl, ruby
Domain
documentation

Research direction

Start at the Ruby Style Guide’s and/or flow section and compare its wording with the linked Perl operator-precedence documentation. Confirm the precedence relationship and revise the paragraph so its comparison is accurate and understandable; done means the explanation no longer contradicts the Perl reference.

Written by the indexing model from the issue text.

Description

Hey there!

I was reading Ruby Style Guide and stumbled upon this paragraph on and/or section:

Also && has higher precedence than ||, whereas and and or have the same one. Funny enough, even though and and or were inspired by Perl, they don’t have different precedence in Perl.

English is not my first language, so I re-read this paragraph multiple times, but still could not understand it. If and and or were inspired by Perl, and they do not have different precedence in Perl, and, as far as I understand the examples, they also do not have different precedence in Ruby, then why is it funny?

The paragraph is 4+ years old, and it was probably read multiple times before me, and I though I just could not get the idea behind the wording. So I went to the Perl docs to find out that and and or have different precedence:

Perl operators have the following associativity and precedence, listed from highest precedence to lowest [...]

...
nonassoc    list operators (rightward)
right       not
left        and
left        or xor

So, I believe I have found an error. If it’s not, can you please explain it to me?

Dominant language
No language data
Stars
16.5k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rubocop/ruby-style-guide

All issues in rubocop/ruby-style-guide

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.