def _is_package_installed(module, name, locallib, cpanm, version):
    cmd = ''
    if locallib:
        os.environ['PERL5LIB'] = ('%s/lib/perl5' % locallib)
    cmd = ("%s perl -e ' use %s" % (cmd, name))
    if version:
        cmd = ("%s %s;'" % (cmd, version))
    else:
        cmd = ("%s;'" % cmd)
    (res, stdout, stderr) = module.run_command(cmd, check_rc=False)
    if (res == 0):
        return True
    else:
        return False
def _is_package_installed(module, name, locallib, cpanm, version):
    cmd = 
    if locallib:
        os.environ['PERL5LIB'] = ('%s/lib/perl5' % locallib)
    cmd = ("%s perl -e ' use %s" % (cmd, name))
    if version:
        cmd = ("%s %s;'" % (cmd, version))
    else:
        cmd = ("%s;'" % cmd)
    (res, stdout, stderr) = module.run_command(cmd, check_rc=False)
    if (res == 0):
        return True
    else:
        return False