Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

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 marked this pull request as ready for review October 17, 2024 14:56
@ac000 ac000 requested review from hongzhidao and javorszky October 17, 2024 14:57
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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