I have a files with data like this for various chromosomes in bp
File 1: 24328000-29166946 25388351-27114603 22310186-25239677 28511024-29638159 23729632-26385029
Solution in Perl code: My code reports no common region in this sections
File 2: 35388351-55114603 37310186-52396773 38511024-48638500 32729632-48638502 17446360-51119526
Solution using Perl code: (as of now it reports only common region):
38511024 - 48638500
Looking for a solution to find the unique and common regions in Perl or other languages.