I have no idea why you say perl is headed to the graveyard. Your premise is wrong so there is no use in discussing it. Perl may not be as popular as it was at one time but it is far fom a dead language.
I don't know what perl does better than python or vice-versa.