use warnings; use strict; my $str = do {local $/ = ''; }; print $str . "\n"; $str =~ s/[^\x00-\x7f]//g; print $str; __DATA__ This € that #### This € that This that