in reply to How to reduce this lengthy code?

First of all, this is an error probably

@data_tranfer_rt_25_count ... $#data_transfer_rt_25_count

note the extra S in tranSfer

Second, this lines:

my %newhash=map{$_=>1} @data_trasfer_list;

can be replaced by:

my %newhash; @newhash{@data_transfer_list} = (1) x scalar @data_transfer_list;

Third. What's in @newlist?