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

perl: Remove unused module constructor #1460

Merged
merged 1 commit into from
Oct 21, 2024
Merged

perl: Remove unused module constructor #1460

merged 1 commit into from
Oct 21, 2024

Conversation

ac000
Copy link
Member

@ac000 ac000 commented Oct 15, 2024

In the perl language module we create a new perl module on the fly comprised of some preamble, the specified perl script and some post-amble.

In the preamble we create a constructor called new(), however this can clash with other constructors also called new.

While this can be worked around by instead of doing

... new CLASS

rather do

... CLASS->new()

While this constructor was added in commit 3b2c1d0 ("Perl: added implementation delayed response and streaming body."), I don't see that we actually use it anywhere (nor is it seemingly something we document) and if we simply remove it then things still seem to work, including the Perl pytests

...
test/test_perl_application.py::test_perl_streaming_body_multiple_responses[5.38.2] PASSED
...
test/test_perl_application.py::test_perl_delayed_response[5.38.2] PASSED
test/test_perl_application.py::test_perl_streaming_body[5.38.2] PASSED
...

@ac000 ac000 linked an issue Oct 15, 2024 that may be closed by this pull request
In the perl language module we create a new perl *module* on the fly
comprised of some preamble, the specified perl script and some
post-amble.

In the preamble we create a constructor called new(), however this can
clash with other constructors also called new.

While this can be worked around by instead of doing

  ... new CLASS

rather do

  ... CLASS->new()

While this constructor was added in commit 3b2c1d0 ("Perl: added
implementation delayed response and streaming body."), I don't see that
we actually use it anywhere (nor is it seemingly something we document)
and if we simply remove it then things still seem to work, including the
Perl pytests

  ...
  test/test_perl_application.py::test_perl_streaming_body_multiple_responses[5.38.2] PASSED
  ...
  test/test_perl_application.py::test_perl_delayed_response[5.38.2] PASSED
  test/test_perl_application.py::test_perl_streaming_body[5.38.2] PASSED
  ...

Closes: nginx#1456
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
@ac000 ac000 merged commit f6036bb into nginx:master Oct 21, 2024
24 checks passed
@ac000 ac000 deleted the perl branch October 21, 2024 22:05
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.

Correct Perl-expression: Failed to parse script
2 participants