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

fix "split to @_ is deprecated" warning #1036

Closed
wants to merge 1 commit into from

Conversation

preaction
Copy link

On Perl 5.10, perl is incorrectly interpreting any split not assigned to
an array as a split intended to replace @_. Since this behavior was
deprecated, Perl is warning about it. This warning is causing tests in
downstream modules (like my Mercury application) which check for
warnings to fail.

I can't find when this deprecation was added (before 5.6), but the
feature was removed from Perl in 5.12, and the warning fixed to only
apply to split called in void context.

The only syntax that prevents this warning is assigning the result of
split to an array. Disabling the category of this warning ("syntax", as
reported in perldiag) does not seem to prevent this warning, but
disabling all warnings does.

On Perl 5.10, perl is incorrectly interpreting any split not assigned to
an array as a split intended to replace @_. Since this behavior was
deprecated, Perl is warning about it. This warning is causing tests in
downstream modules (like my Mercury application) which check for
warnings to fail.

I can't find when this deprecation was added (before 5.6), but the
feature was removed from Perl in 5.12, and the warning fixed to only
apply to split called in void context.

The only syntax that prevents this warning is assigning the result of
split to an array. Disabling the category of this warning ("syntax", as
reported in perldiag) does not seem to prevent this warning, but
disabling all warnings does.
@kraih kraih closed this in 1a37eff Jan 13, 2017
@kraih
Copy link
Member

kraih commented Jan 13, 2017

Testing for warnings unconditionally is a very bad idea imo, and definitely not reason enough to add workarounds to Mojolicious. We generally don't specifically optimize for 5.10.1 either, deprecation warnings (even false ones) are a bit of an odd problem, so i'm not sure if the current workaround will stay. I'd hate for this to result in a wave of pull requests with more workarounds for old versions of Perl.

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.

None yet

2 participants