'Call the given Perl and return:
(<version>, <config_dirs>, <import_path>)
where <config_dirs> is a dict with (relevant) dirs from
Config.pm.'

def _perl_info_from_perl(self, perl, env):

    import process
    info_cmd = 'use    Config;print    "version:$Config{version}\\n";print    "siteprefix:$Config{siteprefix}\\n";print    "archlib:$Config{archlib}\\n";print    "privlib:$Config{privlib}\\n";print    "vendorarch:$Config{vendorarch}\\n";print    "vendorlib:$Config{vendorlib}\\n";print    join("\\n",    @INC);'
    argv = [perl, '-e', info_cmd]
    log.debug("run    `%s    -e    ...'", perl)
    p = process.ProcessOpen(argv, env=env.get_all_envvars(), stdin=None)
    (stdout, stderr) = p.communicate()
    stdout_lines = stdout.splitlines(0)
    retval = p.returncode
    if retval:
        log.warn('failed    to    determine    Perl    info:\n        path:    %s\n        retval:    %s\n        stdout:\n%s\n        stderr:\n%s\n', perl, retval, indent('\n'.join(stdout_lines)), indent(stderr))
    perl_ver = stdout_lines[0].split(':', 1)[1]
    config_dirs = dict(siteprefix=stdout_lines[1].split(':', 1)[1], archlib=stdout_lines[2].split(':', 1)[1], privlib=stdout_lines[3].split(':', 1)[1], vendorarch=stdout_lines[4].split(':', 1)[1], vendorlib=stdout_lines[5].split(':', 1)[1])
    import_path = stdout_lines[6:]
    return (perl_ver, config_dirs, import_path)
