Skip to content

compute the correct varname for control character variables starting with _#24136

Open
book wants to merge 3 commits intobleadfrom
book/gh24135
Open

compute the correct varname for control character variables starting with _#24136
book wants to merge 3 commits intobleadfrom
book/gh24135

Conversation

@book
Copy link
Contributor

@book book commented Jan 29, 2026

This also fixes the issue for the remaining (and unused) control character variables: $^[, $^\, $^], $^^.

Fixes GH #24135.

@khwilliamson
Copy link
Contributor

The change looks good to me, but shouldn't there be tests for the 5 fixed variables?

…with _

This also fixes the issue for the remaining (and unused) control
character variables $^[ $^\ $^] $^^

Fixes GH #24135.
@book book requested review from khwilliamson and leonerd January 29, 2026 22:17
@book
Copy link
Contributor Author

book commented Jan 29, 2026

The change looks good to me, but shouldn't there be tests for the 5 fixed variables?

Just added a test, but besides $^_, the others are not even documented.

@book
Copy link
Contributor Author

book commented Jan 29, 2026

Made another fix to varname, while I was at it.

@book
Copy link
Contributor Author

book commented Jan 29, 2026

Do these changes require a perldelta entry? I suppose so, if they change warning output.

I.e. varname should return ${^FOO} and not $^FOO.
character) in their name.

The names of variables whose names begin with a caret and are longer
than two characters are now wrapped in braces, like they have to be in
Copy link
Contributor

Choose a reason for hiding this comment

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

My high school English teacher would call out this nit:
s/like they/just as they/

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants