bobtfish / text-markdown

The perl Text::Markdown CPAN module
Other
50 stars 21 forks source link

Eliminate `undef` warnings. #19

Open theory opened 12 years ago

theory commented 12 years ago

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