Eliminate `undef` warnings. #19

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
1 participant
@theory

theory commented Jan 16, 2012

I’ve found that Text::Markup sometimes is asked to parse an empty file. It opens it and passes do { local $/; <$fh> } to Text::Markdown. So an undef gets passed, resulting in these warnings:

Use of uninitialized value $text in substitution (s///) at /usr/local/perl/lib/site_perl/5.14.2/Text/Markdown.pm line 270.
Use of uninitialized value $text in substitution (s///) at /usr/local/perl/lib/site_perl/5.14.2/Text/Markdown.pm line 271.

This patch eliminates that warning, and adds tests for it, as well.

Thanks,

David

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