perl5
perl5 copied to clipboard
PERL5OPT doesn't support spaces between switches and their args
Description
On the command line you can have a space in between a -I or -M switch and its argument, but this doesn't work when those switches are supplied in $PERL5OPT.
Steps to Reproduce
With switches on the command line everything works:
$ perl -M lib=local -e0
$ perl -I lib -e0
$
Supplying the same in $PERL5OPT blows up:
$ PERL5OPT=-M\ lib=local perl -e0
Missing argument to -M.
$ PERL5OPT=-I\ lib perl -e0
No directory specified for -I.
Expected behavior
Spaces in between -I and -M and their arguments should be permitted in $PERL5OPT exactly as when they are provided as command line switches.
Perl configuration
Summary of my perl5 (revision 5 version 41 subversion 3) configuration:
Commit id: f8647d3280614d4c72a4ce4e0ee3c20535be74ca
Platform:
osname=darwin
osvers=23.5.0
archname=darwin-2level
uname='darwin harrow.local 23.5.0 darwin kernel version 23.5.0: wed may 1 20:09:52 pdt 2024; root:xnu-10063.121.3~5release_x86_64 x86_64 '
config_args='-de -Dusedevel -Dprefix=/Users/david/Desktop/fooo'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=14.5 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -DHAS_BROKEN_LANGINFO_CODESET -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=14.5 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -DHAS_BROKEN_LANGINFO_CODESET -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='Apple LLVM 15.0.0 (clang-1500.3.9.4)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -mmacosx-version-min=14.5 -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib
libs=
perllibs=
libc=
so=dylib
useshrplib=false
libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -mmacosx-version-min=14.5 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_LONG_DOUBLE
HAS_STRTOLD
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_SIPHASH13
PERL_HASH_USE_SBOX32
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_DEVEL
PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Built under darwin
Compiled at Aug 28 2024 00:04:31
%ENV:
PERLBREW_HOME="/Users/david/.perlbrew"
PERLBREW_MANPATH="/Users/david/perl5/perlbrew/perls/default/man"
PERLBREW_PATH="/Users/david/perl5/perlbrew/bin:/Users/david/perl5/perlbrew/perls/default/bin"
PERLBREW_PERL="default"
PERLBREW_ROOT="/Users/david/perl5/perlbrew"
PERLBREW_SHELLRC_VERSION="0.96"
PERLBREW_VERSION="0.96"
@INC:
lib
/Users/david/Desktop/fooo/lib/perl5/site_perl/5.41.3/darwin-2level
/Users/david/Desktop/fooo/lib/perl5/site_perl/5.41.3
/Users/david/Desktop/fooo/lib/perl5/5.41.3/darwin-2level
/Users/david/Desktop/fooo/lib/perl5/5.41.3