This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / defaultincdot.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 2016 H.Merijn Brand & Todd Rinaldo
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:default_inc_excludes_dot: Myread cat
9 ?MAKE:  -pick add $@ %<
10 ?S:default_inc_excludes_dot:
11 ?S:     When defined, remove the legacy '.' from @INC
12 ?S:.
13 ?C:DEFAULT_INC_EXCLUDES_DOT:
14 ?C:     This symbol, if defined, removes the legacy default behavior of
15 ?C:     including '.' at the end of @INC.
16 ?C:.
17 ?H:#$default_inc_excludes_dot DEFAULT_INC_EXCLUDES_DOT  /**/
18 ?H:.
19 : Include . in @INC
20 $cat <<EOM
21
22 Historically Perl has provided a final fallback of the current working
23 directory '.' when searching for a library. This, however, can lead to
24 problems when a Perl program which loads optional modules is called from
25 a shared directory. This can lead to executing unexpected code.
26
27 EOM
28
29 # When changing to exclude by default:
30 case "$default_inc_excludes_dot" in
31     $undef|false|[nN]*) dflt="n" ;;
32     *)                  dflt="y" ;;
33 esac
34 # To turn exclude off by default:
35 #case "$default_inc_excludes_dot" in
36 #    $define|true|[yY]*) dflt="y" ;;
37 #    *)                  dflt="n" ;;
38 #esac
39
40 rp='Exclude '.' from @INC by default? '
41 . ./myread
42 case "$ans" in
43     [nN]|undef) default_inc_excludes_dot="$undef"  ;;
44     *)          default_inc_excludes_dot="$define" ;;
45 esac
46