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
CommitLineData
d3292687
MBT
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:.
d3292687
MBT
19: Include . in @INC
20$cat <<EOM
21
22Historically Perl has provided a final fallback of the current working
23directory '.' when searching for a library. This, however, can lead to
24problems when a Perl program which loads optional modules is called from
25a shared directory. This can lead to executing unexpected code.
26
27EOM
28
6580b7eb 29# When changing to exclude by default:
d3292687 30case "$default_inc_excludes_dot" in
4a777f3a
MBT
31 $undef|false|[nN]*) dflt="n" ;;
32 *) dflt="y" ;;
d3292687 33esac
4a777f3a
MBT
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
d3292687 39
6580b7eb 40rp='Exclude '.' from @INC by default? '
d3292687
MBT
41. ./myread
42case "$ans" in
6580b7eb
MBT
43 [nN]|undef) default_inc_excludes_dot="$undef" ;;
44 *) default_inc_excludes_dot="$define" ;;
d3292687
MBT
45esac
46