Wanna get rid of these annoying “Wide character in print” warning perl gives you sometimes when dealing with unicode/UTF-8?
Use
binmode(STDOUT, ":utf8"); |
on STDOUT or the appropriate filehandle, and perl will treat it as UTF-8 capable.
You could also use the “-CSDA” option to tell perl that.
Before:
#!/usr/bin/perl -w use charnames ':full'; print "\N{GREEK CAPITAL LETTER DELTA}\n"; |
Gives:
./wide_char.pl Wide character in print at ./wide_char.pl line 9. Δ |
After:
#!/usr/bin/perl -w use charnames ':full'; binmode(STDOUT, ":utf8"); print "\N{GREEK CAPITAL LETTER DELTA}\n"; |

Thanks! Worked perfectly.
I think you should change the line from “get rid of” to “handle”. Honestly, this is the first solution I found that doesn’t just stop the warnings from showing up.
use open qw/:std :utf8/;
I found this at the very start of the file to be more useful in my solution.