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

::Style::Stream should localize $_ [rt.cpan.org #101129] #72

Open
toddr opened this issue Sep 24, 2019 · 0 comments
Open

::Style::Stream should localize $_ [rt.cpan.org #101129] #72

toddr opened this issue Sep 24, 2019 · 0 comments

Comments

@toddr
Copy link
Member

toddr commented Sep 24, 2019

Migrated from rt.cpan.org#101129 (status was 'open')

Requestors:

Attachments:

From [email protected] on 2014-12-25 16:59:50
:

From XML::Parser::Style::Stream:

  sub doText {
    no strict 'refs';
    my $expat = shift;
    $_ = $expat->{Text};

If $_ is read only when this function is called, the function will die with 'Modification of a read-only value attempted'. The fix is to localize $_ here (and everywhere else it is used like this).

I can write a failing test case if it helps. I could also try to write a patch if needed.

From [email protected] on 2015-01-12 06:54:30
:



> I can write a failing test case if it helps. I could also try to write
> a patch if needed.


That would help speed things along.

https://github.com/toddr/XML-Parser

From [email protected] on 2015-01-12 07:53:41
:

"Todd Rinaldo via RT" <[email protected]> writes:

>> I can write a failing test case if it helps. I could also try to write
>> a patch if needed.
>
> That would help speed things along.

Here are two patches.

The first adds a test case that fails with the current code.
The second fixes the bug by localizing $_ in the subs that use it.



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant