Comments (6)
I don't know much about system() and the dividing line between commands/parameters, shell substitution/escapes, etc but suspect it wont be considered a bug. This works under WIn10...
my $cmd=qq("python --version && python -h && perl -v");
print("Command => $cmd\n");
system($cmd);
Command => "python --version && python -h && perl -v"
Python 3.9.4
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
[...]
This is perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x64-multi-thread
[...]
from perl-dist-strawberry.
Thanks for the fast reply.
Maybe it is not a bug in perl itself but I think there is a problem somewhere: it is quite disturbing that this code runs differently on Strawberry Perl compared to other perl versions (including on the same OS with Git Bash). Especially since Strawberry Perl is designed to be as close as possible to perl environment on UNIX systems.
.
What do you think?
from perl-dist-strawberry.
This is likely a generic issue with how system
calls are run under windows.
The Strawberry perl environment is close to unix in how it is built and some of the tools provided, but still runs as a Windows program. Any system call will use the windows shell, not a unix shell (although I think some system calls sidestep the shell).
Git bash is a cut-down version of MSYS (or a similar environment) so is essentially a unix environment. That would be why it behaves as expected.
What happens when you run the script using a non-Strawberry perl on native Windows?
from perl-dist-strawberry.
Thanks for reviving this topic @shawnlaffan 😃
I tried to run the following code
my $cmd="python --version && python -h";
print("Command => $cmd\n");
system($cmd);
with ActiveState perl 5.36.0 on Windows 10 and here is the output:
Command => python --version && python -h
➡️ None of the python commands are run so the behaviour is wrong (or at least not expected) and different than Strawberry perl (I was not able to try the same code with a recent version of Strawberry perl because the website https://strawberryperl.com/ is currently down...).
from perl-dist-strawberry.
Thanks for trying with AS Perl. This would seem to be a more generic issue than Strawberry Perl.
It's probably worth following up with sites like perlmonks, stackoverflow or reddit.
And out of curiosity, do you get the same issue when running under powershell? (This will need manual path updates as we don't yet have a powershell version of portableshell.bat - see #52).
Once I get a strawberry 5.36 build working I'll also have a go with that.
from perl-dist-strawberry.
Testing under 5.36 shows the same behaviour.
Given the issue is more generic than Strawberry Perl it is best raised on a more general channel, and perhaps as a perl issue.
I'll close this issue in a few days unless there are good reasons to keep it open.
from perl-dist-strawberry.
Related Issues (20)
- perl 5.36.1 builds with gcc-13.1 HOT 20
- Build system: set PERL_CPANM_HOME to a subdir of strawberry_build
- perl 5.36 cpan | OpenGL fails tests HOT 4
- Task::Kensho install failures. HOT 24
- MCF threads or POSIX threads ? HOT 4
- CPAN builds - assess use of App::cpm HOT 3
- 5.38.1 release? HOT 1
- [SP-5.38.0.1] $Config{libpth} contains non-existent directory HOT 5
- Imager segfaults on T1 tests HOT 8
- Astro::FITS::CFITSIO fails a file creation test HOT 1
- Duplication of "-D__USE_MINGW_ANSI_STDIO" in CCFLAGS in 5.38.0_20230705 HOT 2
- https://strawberryperl.com/support.html still links to rt.cpan.org, which doesn't seem to want to be linked to HOT 3
- perl 5.36 cpan | Pod-Parser fails tests HOT 2
- perl 5.36 cpan | PDL build fails HOT 48
- Update release notes for 5.36 and 5.38 HOT 2
- perl 5.36 cpan | Inline:C failures with 20230420 dev release when path is not C:\strawberry HOT 14
- Strawberry Perl 32bit version HOT 3
- 5.37.11 build HOT 8
- Tk build fails (Perl 5.36 sp536 20230420) HOT 18
- config files: make install_packages steps deterministic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl-dist-strawberry.