in reply to Re: Handling MSWin Script Output
in thread Handling MSWin Script Output
G'day Orangutan,
Yes, I found out about the './ and '.\ early on when I tried just 'test_platform.pl'. There was a lot of output, which I won't post here; however, the last part of that had 'Suggestion [3,General]: The command test_platform.pl was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\test_platform.pl". ...'.
This is pretty much the same as UNIX-like systems when '.' is not in the path. Using my Cygwin:
$ test_platform.pl -bash: test_platform.pl: command not found $ ./test_platform.pl Platform: cygwin Executable: /home/ken/perl5/perlbrew/perls/perl-5.30.0/bin/perl
So, from PowerShell
perl test_platform.pl perl ./test_platform.pl perl .\test_platform.pl
all work identically to how I described 'perl ./test_platform.pl' in the OP. And
./test_platform.pl .\test_platform.pl
both work identically to how I described './test_platform.pl' in the OP.
Anyway, what you've described regarding how the Perl interpreter is called, does make sense, and probably answers Question 2. It's a pity, because I'd prefer not to have to type 'perl' before every script name; still, it is only for a work project and won't generally affect me as I'm normally using Cygwin.
I also noticed that you'd signed up only a fortnight ago; so please accept a belated welcome to the Monastery.
— Ken
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Handling MSWin Script Output
by Orangutan (Novice) on Sep 11, 2019 at 17:34 UTC |