$str = join '', map {$_ & 0x7f} split //, $str; #### $str =~ s/(.)/$1 & 0x7f/eg;