Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“delete local $hash{$key}” requires Perl v5.12 #17

Open
jwilk opened this issue Apr 2, 2019 · 0 comments
Open

“delete local $hash{$key}” requires Perl v5.12 #17

jwilk opened this issue Apr 2, 2019 · 0 comments

Comments

@jwilk
Copy link

jwilk commented Apr 2, 2019

From perl5120delta:

delete local now allows you to locally delete a hash entry.

Technically, the delete local $hash{$key} syntax was valid in previous versions of Perl, but, unexpectedly, it didn't delete entries locally.
I think it's safe to assume that all users of this syntax really want local delete, so Perl::MinimumVersion should report v5.12 as the minimum syntax version.

You can use this code for testing:

my %hash = (0 => 0);
{
    delete local $hash{0};
}
print '"delete local $hash{$key}" was ' . (defined $hash{0} ? '' : 'NOT '). "local\n";
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

No branches or pull requests

1 participant