in reply to Removing wide characters

This may do what you want:

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

Prints:

This € that This that

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Removing wide characters
by TomG (Initiate) on Dec 09, 2005 at 00:07 UTC
    Thank you very much Grandfather and BorgCopyeditor. Both solutions were helpful and worked fine. Tom
Re^2: Removing wide characters
by Anonymous Monk on Oct 17, 2015 at 00:33 UTC
    Very helpful... I found such a character in the column names of paypal transaction csvs... maddening until I found out just what was going on!
Re^2: Removing wide characters
by Anonymous Monk on Mar 08, 2020 at 07:52 UTC

    Thanks a lot. This solved my problem. I was facing this problem from last 4 days.