Skip to content

Conversation

@book
Copy link
Contributor

@book book commented Nov 26, 2025

The third paragraph of perlop says:

There are a few exceptions though: The operator x can be either string repetition or list repetition, depending on the type of the left operand, and &, |, ^ and ~ can be either string or numeric bit operations.

I think it would be worth mentioning the 'bitwise' feature there, which gives the bitwise operators a numeric and a string version, making them less of an exception in modern Perl.

@Grinnz said on IRC:

given that use v5.28 and above enable it automatically, I think it's worth explicitly calling out the different reality in modern perl

This patch is the smallest thing I could come up with, and this PR is meant to be a conversation starter to find a better wording for this.

  • This set of changes does not require a perldelta entry.


There are a few exceptions though: The operator C<x> can be either string
repetition or list repetition, depending on the type of the left
operand, and C<&>, C<|>, C<^> and C<~> can be either string or numeric bit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this part could even be pre-empted by a parenthetical so the reader knows whether they have to think about it: and (unless C<use v5.28>+ or L<the bitwise feature> is in effect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants