From 83de5f0e4561b62e4113dfadce0a400a35ec9aa0 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 3 Jun 2021 15:14:31 -0400 Subject: [PATCH] Lp 1930747: Use Constant MARC_NAMESPACE in AppUtils Use the Perl "constant" pragma for MARC_NAMESPACE in OpenILS:: Application::AppUtils to better convey the intention of the code and to protect it from accidental change. Signed-off-by: Jason Stephenson --- Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index dbf8f70a53..619c3c2a42 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -25,7 +25,7 @@ use Digest::MD5 qw(md5_hex); # Pile of utilty methods used accross applications. # --------------------------------------------------------------------------- my $cache_client = "OpenSRF::Utils::Cache"; -my $MARC_NAMESPACE = 'http://www.loc.gov/MARC21/slim'; +use constant MARC_NAMESPACE => 'http://www.loc.gov/MARC21/slim'; # --------------------------------------------------------------------------- # on sucess, returns the created session, on failure throws ERROR exception @@ -2437,8 +2437,8 @@ sub verify_migrated_user_password { sub marc_xml_to_doc { my ($class, $xml) = @_; my $marc_doc = XML::LibXML->new->parse_string($xml); - $marc_doc->documentElement->setNamespace($MARC_NAMESPACE, 'marc', 1); - $marc_doc->documentElement->setNamespace($MARC_NAMESPACE); + $marc_doc->documentElement->setNamespace(MARC_NAMESPACE, 'marc', 1); + $marc_doc->documentElement->setNamespace(MARC_NAMESPACE); return $marc_doc; } -- 2.11.0