add Porting/perlhist_calculate.pl to RMG