'Run before install so that the standard Spack sbang install hook
can fix up the path to the perl binary.'

@run_before('install')
def filter_sbang(self):

    with working_dir('src/perl'):
        match = '^#!/usr/bin/env    perl'
        perl = join_path(self.spec['perl'].prefix.bin, 'perl')
        substitute = '#!{perl}'.format(perl=perl)
        files = ['fill-aa', 'fill-an-ac', 'fill-fs', 'fill-ref-md5', 'tab-to-vcf', 'vcf-annotate', 'vcf-compare', 'vcf-concat', 'vcf-consensus', 'vcf-contrast', 'vcf-convert', 'vcf-fix-newlines', 'vcf-fix-ploidy', 'vcf-indel-stats', 'vcf-isec', 'vcf-merge', 'vcf-phased-join', 'vcf-query', 'vcf-shuffle-cols', 'vcf-sort', 'vcf-stats', 'vcf-subset', 'vcf-to-tab', 'vcf-tstv', 'vcf-validator']
        kwargs = {'ignore_absent': True, 'backup': False, 'string': False}
        filter_file(match, substitute, *files, **kwargs)
