Skip to content

Conversation

jkeenan
Copy link
Contributor

@jkeenan jkeenan commented Oct 6, 2025

Provide simple examples of goto &NAME syntax used incorrectly.

Fixes: GH #23811


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

Provide simple examples of goto &NAME syntax used incorrectly.

Fixes: GH Perl#23811
Copy link
Contributor

@mauke mauke left a comment

Choose a reason for hiding this comment

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

I don't see what this has to do with #23811.

It looks like you're trying to test the Can't goto subroutine from an eval-block error, but we already have a test for that (line 205).

The goto &{ ... } and goto &$foo syntax variants are already exercised by lines 345 and 260 in this file.

# GH 23811 goto &NAME where block evaluates to coderef
{
local $@;
my $hw = 'hello world';
Copy link
Contributor

Choose a reason for hiding this comment

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

What is $hw for?

like($@, qr/^Can't goto subroutine from an eval-block/,
"Can't goto subroutine (block which evaluates to coderef) from an eval block");

undef $@;
Copy link
Contributor

Choose a reason for hiding this comment

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

undef $@ is redundant before eval. Every eval resets $@.

@jkeenan jkeenan self-assigned this Oct 9, 2025
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