From 751b55b7c68285b09107089ff240d897ec220d64 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 12 Feb 2021 15:00:46 -0700 Subject: [PATCH] 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 --- Markdown.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Markdown.pl b/Markdown.pl index 40f66c1..6e7bc15 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -12,7 +12,7 @@ package Markdown; -require 5.008; +use 5.008; use strict; use warnings; @@ -28,16 +28,18 @@ All rights reserved. *VERSION = \"1.1.11-PRE" } -require Exporter; +use Exporter (); use Digest::MD5 qw(md5 md5_hex); use File::Basename qw(basename); use Scalar::Util qw(refaddr looks_like_number); my ($hasxml, $hasxml_err); BEGIN { ($hasxml, $hasxml_err) = (0, "") } my ($hasxmlp, $hasxmlp_err); BEGIN { ($hasxmlp, $hasxmlp_err) = (0, "") } +BEGIN { @ISA = qw(Exporter); @EXPORT_OK = qw(Markdown ProcessRaw GenerateStyleSheet SetWikiOpts SplitURL escapeXML unescapeXML ResolveFragment); $INC{__PACKAGE__.'.pm'} = $INC{basename(__FILE__)} unless exists $INC{__PACKAGE__.'.pm'}; +} close(DATA) if fileno(DATA); exit(&_main(@ARGV)||0) unless caller;