I have a variant list in VCF file for a particular disease, I want to filter these variants according to exonic regions in a BED file using a Perl script. How I do this?
Don't reinvent the wheel. Use BEDTools.
And no one on any Stack Exchange board wants to write you a perl script.
As a fuller explanation, use bedtools with the intersect command:
bedtools intersect -u -a variantList.vcf -b exonicRegions.bed > filteredVariants.vcf
While this should work, if your vcf version is giving you trouble use vcf2bed to convert the vcf to a bed file, then intersect directly.