Skip to content

Conversation

@tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Apr 23, 2025

I was looking over #1674, where it was suggested that late INIT blocks behave like BEGIN, and Larry approved of that (25 years ago).

But history has moved on, we have 25 years of code developed under the current behaviour of INIT and I suspect such a change is more likely to break existing code than fix anything.

But looking at the code in S_process_special_blocks() we do still push the CV onto PL_initav, even though that CV will never be called.

So don't push the CV if it's too late to call it.


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

@jkeenan jkeenan added the defer-next-dev This PR should not be merged yet, but await the next development cycle label Apr 23, 2025
@jkeenan
Copy link
Contributor

jkeenan commented Apr 23, 2025

We can begin to discuss this p.r., but due to code freeze cannot merge it until the 5.43 development cycle starts. Hence, I've labelled this "defer-next-dev."

@jkeenan jkeenan removed the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jul 3, 2025
@jkeenan
Copy link
Contributor

jkeenan commented Jul 3, 2025

We can begin to discuss this p.r., but due to code freeze cannot merge it until the 5.43 development cycle starts. Hence, I've labelled this "defer-next-dev."

5.43.0 has been released; development on this p.r. may resume.

I was looking over Perl#1674, where it was suggested that late INIT blocks
behave like BEGIN, and Larry approved of that (25 years ago).

But history has moved on, we have 25 years of code developed under the
current behaviour of INIT and I suspect such a change is more likely
to break existing code than fix anything.

But looking at the code in S_process_special_blocks() we do still push
the CV onto PL_initav, even though that CV will never be called.

So don't push the CV if it's too late to call it.
@tonycoz tonycoz merged commit 851c968 into Perl:blead Jul 9, 2025
33 checks 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.

3 participants