my @HEX = (0..9 , 'A'..'F'); $println =~ s/\x0A/\x0D\x0A/g; foreach my $i (@HEX) { foreach my $j (@HEX) { $println =~ s/(\x$i$j)/$1\x00/g; }#foreach }#foreach