Revision history for local::lib
+1.003001 2009-01-14
+ - Properly bail if given fancy dashes obtained by copy-pasting from a
+ UTF8-happy POD formatter. This will bail in both the Makefile.PL and
+ in local::lib::import().
+
1.003000 2009-01-13
- Add the --self-contained flag from Mark Stosberg, which also contains
a doc patch warning about the dangers of UNINST=1. Thanks, Mark!
use vars qw($bootstrapping);
BEGIN {
+ # watch out for fancy dashes. these can wind up in our @ARGV if the user is
+ # copypasting the bootstrap command from the POD displayed e.g. by perldoc
+ # on a Mac OS X terminal. since no software recognizes and handles these
+ # 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) {
+ 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
+probably got these by copy-pasting from the perldoc for this module as
+rendered by a UTF8-capable formatter. This most typically happens on an OS X
+terminal, but can happen elsewhere too. Please try again after replacing the
+dashes with normal minus signs.
+DEATH
+ }
if (my ($x) = grep { /^--bootstrap(?:=.*)?$/ } @ARGV) {
@ARGV = grep { !/^--bootstrap(?:=.*)?$/ } @ARGV;
$bootstrapping = 1;
use Carp ();
use Config;
-our $VERSION = '1.003000'; # 1.2.0
+our $VERSION = '1.003001'; # 1.3.1
sub import {
my ($class, @args) = @_;
# Handle the '--self-contained' option
my $flag = shift @args;
no warnings 'uninitialized'; # the flag is optional
+ # make sure fancy dashes cause an error
+ if ($flag =~ /−/) {
+ 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
+probably got these by copy-pasting from the perldoc for this module as
+rendered by a UTF8-capable formatter. This most typically happens on an OS X
+terminal, but can happen elsewhere too. Please try again after replacing the
+dashes with normal minus signs.
+DEATH
+ }
if ($flag eq '--self-contained') {
# The only directories that remain are those that we just defined and those where core modules are stored.
@INC = ($Config::Config{privlibexp}, $Config::Config{archlibexp}, split ':', $ENV{PERL5LIB});