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

Ensure weak references in use in HTML::TreeBuilder? #5

Merged
merged 1 commit into from Mar 6, 2015

Conversation

Projects
None yet
2 participants
@vzvu3k6k
Collaborator

vzvu3k6k commented Mar 5, 2015

Thanks to weak references, we can forget about HTML::TreeBuilder::delete (HTML::TreeBuilder document). It eliminates the need for XPathFeed::(clean|DESTROY).

This change also stops prove -l from printing the warnings of "Use of uninitialized value $url ...". These warnings are caused by unintended initialization of $self->tree invoked by XPathFeed::clean.

By this change, perl without Scalar::Util::weaken will not be able to run XPathFeed. But Scalar::Util::weaken is bundled with perl since 5.8.0, so I believe this change will work in most environments.

(@onishi, what do you think about it?)

Ensure weak references in use in HTML::TreeBuilder
Thanks to weak references, we can forget about
HTML::TreeBuilder::delete. It eliminates the need for
XPathFeed::(clean|DESTROY).

And `prove -l` won't print the warnings of "Use of uninitialized value
$url ..." anymore. These warnings are caused by unintended
initialization of $self->tree invoked by XPathFeed::clean.
@onishi

This comment has been minimized.

Show comment
Hide comment
@onishi

onishi Mar 6, 2015

Owner

oh, I didn't know about -weak option.
I think this change is no problem whatsoever.

Owner

onishi commented Mar 6, 2015

oh, I didn't know about -weak option.
I think this change is no problem whatsoever.

onishi added a commit that referenced this pull request Mar 6, 2015

Merge pull request #5 from vzvu3k6k/test-undef-warn
Ensure weak references in use in HTML::TreeBuilder?

@onishi onishi merged commit e6f7b6b into onishi:master Mar 6, 2015

@vzvu3k6k vzvu3k6k deleted the vzvu3k6k:test-undef-warn branch Mar 6, 2015

@vzvu3k6k

This comment has been minimized.

Show comment
Hide comment
@vzvu3k6k

vzvu3k6k Mar 6, 2015

Collaborator

Thanks 🌷

Collaborator

vzvu3k6k commented Mar 6, 2015

Thanks 🌷

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