def build_perl_study_url(local_study_pk, edd_hostname, https=False):
    """
    Builds a Perl-style study URL created by the older Perl version of EDD.
    :param local_study_pk:  the numeric study primary key
    :param https: True to use HTTPS, False for plain HTTP
    :param edd_hostname: the host name for EDD
    """
    scheme = 'https' if https else 'http'
    return '%(scheme)s://%(hostname)s/Study.cgi?studyID=%(study_pk)s' % {
        'hostname': edd_hostname, 'scheme': scheme, 'study_pk': local_study_pk
    }