Discipulus has asked for the wisdom of the Perl Monks concerning the following question:
win32 systems do not glob * in the command line. Infact when I want a * to be expandded I use a BEGIN blok like BEGIN { @ARGV = map glob, @ARGV; print qq(considering ).scalar @ARGV.qq( files\n);}
But today I've packed a little script that accepts a * as first argument and the packed version do not worked in the same way as the original perl program.
As test i packed the following oneliner:
pp -e "print join qq(\n), @ARGV" -o printargv.exe >printargv.exe hello world! hello world! >printargv.exe * # all plain files and dirs in current path (no dot files in the list.. +) >printargv.exe *.pl # all .pl file in current directory
What is happening there? Is PAR globbing for me?
As suggested by Corion the following shows how the simple perl version runs:
>perl -we "print join qq(\n), @ARGV" * *
As you can see a lone star is printed.
L*
PS
#strawberry perl version perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x64-multi +-thread PAR 1.015 PAR::Packer 1.041
UPDATED after beech's request below:
Summary of my perl5 (revision 5 version 26 subversion 0) configuration +: Platform: osname=MSWin32 osvers=6.3 archname=MSWin32-x64-multi-thread uname='Win32 strawberry-perl 5.26.0.2 #1 Sat Sep 2 16:25:32 2017 +x64' config_args='undef' hint=recommended useposix=true d_sigaction=undef useithreads=define usemultiplicity=define use64bitint=define use64bitall=undef uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='gcc' ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANS +I_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLIC +IT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields' optimize='-s -O2' cppflags='-DWIN32' ccversion='' gccversion='7.1.0' gccosandvers='' intsize=4 longsize=4 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long long' ivsize=8 nvtype='double' nvsize=8 Off_t='long long' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='g++.exe' ldflags ='-s -L"D:\ulisseDUE\perl5.26.64bit\perl\lib\CORE" -L"D:\u +lisseDUE\perl5.26.64bit\c\lib"' libpth=D:\ulisseDUE\perl5.26.64bit\c\lib D:\ulisseDUE\perl5.26.64b +it\c\x86_64-w64-mingw32\lib D:\ulisseDUE\perl5.26.64bit\c\lib\gcc\x86 +_64-w64-mingw32\7.1.0 libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 + -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 - +lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomd +lg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_ +32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 libc= so=dll useshrplib=true libperl=libperl526.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs dlext=xs.dll d_dlsymun=undef ccdlflags=' ' cccdlflags=' ' lddlflags='-mdll -s -L"D:\ulisseDUE\perl5.26.64bit\perl\lib\CORE" +-L"D:\ulisseDUE\perl5.26.64bit\c\lib"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Sep 2 2017 16:39:31 %ENV: PERL_JSON_BACKEND="JSON::XS" PERL_RL="Perl" PERL_YAML_BACKEND="YAML" @INC: D:/ulisseDUE/perl5.26.64bit/perl/site/lib/MSWin32-x64-multi-thread D:/ulisseDUE/perl5.26.64bit/perl/site/lib D:/ulisseDUE/perl5.26.64bit/perl/vendor/lib D:/ulisseDUE/perl5.26.64bit/perl/lib
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PAR pp glob for me on windows?
by pryrt (Abbot) on Mar 27, 2018 at 19:18 UTC | |
by Discipulus (Canon) on Mar 27, 2018 at 20:35 UTC | |
|
Re: PAR pp glob for me on windows?
by vr (Curate) on Mar 28, 2018 at 18:10 UTC | |
by Discipulus (Canon) on Mar 29, 2018 at 11:45 UTC | |
by pryrt (Abbot) on Mar 29, 2018 at 13:21 UTC | |
by vr (Curate) on Mar 29, 2018 at 15:36 UTC | |
|
Re: PAR pp glob for me on windows?
by beech (Parson) on Mar 27, 2018 at 20:52 UTC | |
|
Re: PAR pp glob for me on windows?
by afoken (Chancellor) on Mar 27, 2018 at 15:22 UTC | |
|
Re: PAR pp glob for me on windows?
by swl (Prior) on Mar 27, 2018 at 22:50 UTC |