Browse Source

Markdown.pl: use some sanity

Replace 'require' with 'use' in a few places where it
should have been "used" in the first place.

Make sure the essential package variables are initialized
inside a BEGIN block.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 4 years ago
parent
commit
751b55b7c6
  1. 6
      Markdown.pl

6
Markdown.pl

@ -12,7 +12,7 @@
package Markdown; package Markdown;
require 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings;
@ -28,16 +28,18 @@ All rights reserved.
*VERSION = \"1.1.11-PRE" *VERSION = \"1.1.11-PRE"
} }
require Exporter; use Exporter ();
use Digest::MD5 qw(md5 md5_hex); use Digest::MD5 qw(md5 md5_hex);
use File::Basename qw(basename); use File::Basename qw(basename);
use Scalar::Util qw(refaddr looks_like_number); use Scalar::Util qw(refaddr looks_like_number);
my ($hasxml, $hasxml_err); BEGIN { ($hasxml, $hasxml_err) = (0, "") } my ($hasxml, $hasxml_err); BEGIN { ($hasxml, $hasxml_err) = (0, "") }
my ($hasxmlp, $hasxmlp_err); BEGIN { ($hasxmlp, $hasxmlp_err) = (0, "") } my ($hasxmlp, $hasxmlp_err); BEGIN { ($hasxmlp, $hasxmlp_err) = (0, "") }
BEGIN {
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT_OK = qw(Markdown ProcessRaw GenerateStyleSheet SetWikiOpts SplitURL @EXPORT_OK = qw(Markdown ProcessRaw GenerateStyleSheet SetWikiOpts SplitURL
escapeXML unescapeXML ResolveFragment); escapeXML unescapeXML ResolveFragment);
$INC{__PACKAGE__.'.pm'} = $INC{basename(__FILE__)} unless exists $INC{__PACKAGE__.'.pm'}; $INC{__PACKAGE__.'.pm'} = $INC{basename(__FILE__)} unless exists $INC{__PACKAGE__.'.pm'};
}
close(DATA) if fileno(DATA); close(DATA) if fileno(DATA);
exit(&_main(@ARGV)||0) unless caller; exit(&_main(@ARGV)||0) unless caller;

Loading…
Cancel
Save