Skip to content

PAUSE::pmfile: accept a $VERSION assignment inside a one-line BEGIN - #600

Merged
rjbs merged 1 commit into
andk:masterfrom
rjbs:begin-version
Oct 28, 2026
Merged

rjbs merged 1 commit into
andk:masterfrom
rjbs:begin-version

Conversation

@rjbs

@rjbs rjbs commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

There's no good reason anymore to reject:

BEGIN { our $VERSION = '1.0' }

…given we accept the version without BEGIN. It's statically simple.

The old eval-based code got undef for these lines, because the BEGIN block ran while its wrapper was being compiled, before the wrapper cleared $VERSION. Now they get their real version. In the minicpan corpus, this affects 19 files in 6 dists.

There's no good reason anymore to reject:

BEGIN { our $VERSION = '1.0' }

…given we accept the version without BEGIN. It's statically simple.

The old eval-based code got undef for these lines, because the BEGIN
block ran while its wrapper was being compiled, before the wrapper
cleared $VERSION. Now they get their real version. In the minicpan
corpus, this affects 19 files in 6 dists.

Co-Authored-By: Claude <noreply@anthropic.com>
@rjbs
rjbs merged commit 6b80be8 into andk:master Oct 28, 2026
1 check passed
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.

2 participants