if [[ $0 == *clean ]]; then
    unset LD_LIBRARY_PATH
fi

# default MST_ROOT to dirname of $0

: ${@MST_ROOT_VAR@:=$(dirname $(dirname $0))}

set_mst_envs
get_platforms
get_perl_exe

if (( PERLWRAP_CLEAN_ENV )); then
    unset PERLLIB PERL5LIB
else
    set_perl_environment
fi

exec "$PERL" ${1+"$@"}

# just in case
die "$0: internal and unexpected error"
