dc16b1c5c.0 MSG:aA8raG73tnfvnNgm3mUGICaKAUaCo9IBbE8mmYYF+WDgfM5JU92uQeg==
[IDP] ERROR 2017-10-21 13:01:55,940 PCKAS1 PID:3832 THID:3160 ID:{A312CB7C-1B34-42ec-9357-D8D11E1963D8}:742.209460.e56ed98608316959d5ba357bcf74c2cdc16b1c5c.0 MSG:aALNbkW96pd35xCJ7gzO/JVuW2cUdceXqmxm4xD24Y5RqS/me5NiGESE16f36nyWzXhArbsiP03OJzngDFW9Obs7hGOU=
[IDP] WARN 2017-10-21 13:01:55,940 PCKAS1 PID:3832 THID:3160 ID:{A312CB7C-1B34-42ec-9357-D8D11E1963D8}:1240.209460.e56ed98608316959d5ba357bcf74c2cdc16b1c5c.0 MSG:aAQ5rkEN9APEGjCMmcPTA+25hMP6Zj2wb3qRZ3zFn3f/qWodOkZmOuDZd+BfPllFFVYZNS/Y033mCmus+VuAn87VcKOQ=
[IDP] WARN 2017-10-21 13:01:55,940 PCKAS1 PID:3832 THID:3160 ID:{A312CB7C-1B34-42ec-9357-D8D11E1963D8}:798.209460.e56ed98608316959d5ba357bcf74c2cdc16b1c5c.0 MSG:aDkxXujl+2pVBhdDGjbEFUjrzjKJsgIkbXtbV3g6BsrOlKMyxa17Lj1bGVhxmcBMfEMFCkPqB884w7m0nBu2lbW8dR85BDMefNY2xu/nFMmMPyaOKWbKuMiKjtrJz4Z+n
[IDP] WARN 2017-10-21 13:01:55,940 PCKAS1 PID:3832 THID:3160 ID:{A312CB7C-1B34-42ec-9357-D8D11E1963D8}:962.209460.e56ed98608316959d5ba357bcf74c=head1 NAME

CFX5::PkgLoader - on-demand package loading and error reporting

=head1 SYNOPSIS

  use CFX5::PkgLoader qw(cfx5_require);

  if ($need_something) {
    cfx5_require('CFX5::Something');
  }

=head1 DESCRIPTION

This package provides supporting code for on-demand package loading within CFX-5.  It is basically identical 

  $Id: PkgLoader.pm 43293 2003-11-26 15:58:41Z cfdasm $

=cut

package CFX5::PkgLoader;

use Exporter;
@ISA = qw(Exporter);

@EXPORT_OK = qw(cfx5_require);

use strict;

#use CFX5::Output qw(:all);

=head2 PACKAGE LOADING

=head3 cfx5_require

=cut

sub cfx5_require {
  for my $pkg (@_) {
    # if the output is fully initialised, record what we're doing.  We
    # are called as part of the initialisation, though, so if that's
    # the case don't try it!
    #if (defined &CFX5::Output::is_init and CFX5::Output::is_init()) {
    #  CFX5::Output::_debug("require $pkg");
    #}
    eval "require $pkg;";
    if ($@) {
      (my $msg=$@) =~ s!^! !mg;
      eval {
        require CFX5::Output;
        CFX5::Output::internal_error("Required module $pkg could not be loaded, execution cannot continue.  The error given was:\n\n$msg");
      };
      if ($@) {
        die "Required module $pkg could not be loaded, execution cannot continue.  The error given was:\n\n$msg";
      }
    }
  }
  1;
}

1;
