@quarantinesupport@# define modules runtine quarantine configuration
@quarantinesupport@@setquarvars@$ENV{'MODULES_RUN_QUARANTINE'} = '@RUN_QUARANTINE@';
@quarantinesupport@@setquarvars@@$ENV{'RUNENV_VAR'} = 'RUNENV_VAL';@
@quarantinesupport@@notsetquarvars@#$ENV{'MODULES_RUN_QUARANTINE'} = 'ENVVARNAME';
@quarantinesupport@@notsetquarvars@
@quarantinesupport@# setup quarantine if defined
@quarantinesupport@my $_mlre = '';
@quarantinesupport@if (defined $ENV{'MODULES_RUN_QUARANTINE'}) {
@quarantinesupport@  foreach my $_mlv (split(' ', $ENV{'MODULES_RUN_QUARANTINE'})) {
@quarantinesupport@     if ($_mlv =~ /^[A-Za-z_][A-Za-z0-9_]*$/) {
@quarantinesupport@        if (defined $ENV{$_mlv}) {
@quarantinesupport@           $_mlre .= "${_mlv}_modquar='$ENV{$_mlv}' ";
@quarantinesupport@        }
@quarantinesupport@        my $_mlrv = "MODULES_RUNENV_$_mlv";
@quarantinesupport@        $_mlre .= "$_mlv='$ENV{$_mlrv}' ";
@quarantinesupport@    }
@quarantinesupport@  }
@quarantinesupport@  if ($_mlre ne "") {
@quarantinesupport@     $_mlre = "env $_mlre";
@quarantinesupport@  }
@quarantinesupport@}
@quarantinesupport@
@quarantinesupport@eval `${_mlre}@TCLSH@ @libexecdir@/modulecmd.tcl perl autoinit`;
@notquarantinesupport@eval `@TCLSH@ @libexecdir@/modulecmd.tcl perl autoinit`;

@quarantinesupport@# clean temp variable used to setup quarantine
@quarantinesupport@undef $_mlre;
@quarantinesupport@
@compatversion@# redefine module command if compat version has been activated
@compatversion@if ($ENV{'MODULES_USE_COMPAT_VERSION'} eq '1') {
@compatversion@   $ENV{'MODULES_CMD'} = '@libexecdir@/modulecmd-compat';
@compatversion@   { no warnings 'redefine';
@compatversion@      *module = sub {
@compatversion@         eval `@libexecdir@/modulecmd-compat perl @_`;
@compatversion@         # return value as done on new main version
@compatversion@         return 1;
@compatversion@      };
@compatversion@   }
@compatversion@}
@compatversion@
1;
