From: Jason Stephenson Date: Thu, 3 Jun 2021 19:14:31 +0000 (-0400) Subject: Lp 1930747: Use Constant MARC_NAMESPACE in AppUtils X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=83de5f0e4561b62e4113dfadce0a400a35ec9aa0;p=working%2FEvergreen.git 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 --- 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; }