package MST::Shim::Config;

# monkeypatch Perl's Config database for local overrides

use strict;
use warnings;

use Config;

my %preset;

sub import;

BEGIN {
    %preset = ( startperl => '#! /usr/bin/env /proj/axaf/bin/perl' );

    sub import {

        my $class = shift;

        @_ = ( 'startperl' ) unless @_;

        my %attr;

        if ( @_ == 1 ) {

            my @keys = 'ARRAY' eq ref $_[0] ? @{ $_[0] } : @_;

            @attr{@keys} = @preset{@keys};
        }
        else {
            %attr = @_;
        }

        my $config = tied( %Config::Config );
        $config->{$_} = $attr{$_} for keys %attr;
    }

    import();

}

1;
