If someone (e.g. me!) slaps in a 'use utf8;' into the old version of the
document, then the check would always fail. This way we will catch the
character even if 'use utf8' is added later.
# dashes, it's better to die loudly telling the user exactly what happened
# so they don't make the same mistake again rather than being the only
# program in the universe that works with them.
- if(grep { /−/ } @ARGV) {
+ # the fancy dash is U+2212 or \xE2\x88\x92
+ if(grep { /\xE2\x88\x92/ } @ARGV or grep { /−/ } @ARGV) {
die <<'DEATH';
WHOA THERE! It looks like you've got some fancy dashes in your commandline!
These are *not* the traditional -- dashes that software recognizes. You
my %arg_store;
for my $arg (@args) {
# check for lethal dash first to stop processing before causing problems
- if ($arg =~ /−/) {
+ # the fancy dash is U+2212 or \xE2\x88\x92
+ if ($arg =~ /\xE2\x88\x92/ or $arg =~ /−/) {
die <<'DEATH';
WHOA THERE! It looks like you've got some fancy dashes in your commandline!
These are *not* the traditional -- dashes that software recognizes. You