Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Strange problem with Windows 7 command line and perl

by ww (Archbishop)
on Feb 12, 2017 at 23:20 UTC ( #1181868=note: print w/replies, xml ) Need Help??

in reply to Re^2: Strange problem with Windows 7 command line and perl
in thread Strange problem with Windows 7 command line and perl

The answer (unless the anon post is not by the OP, anonypl -- which I grant may be the case) in Re: Strange problem with Windows 7 command line and perl re using the FULL (emphasis supplied) path, as suggested by poj, seems to mean that line I asked about is NOT the path to perl.exe, be it strawberry or anything else.

Am I missing something? The path with the intermediate "c" doesn't work here because the path -- unsurprisingly -- can't be found. But that's not the problem in the OP, and the node mentioned in para 1 shows the machine finding perl cheerfully, in the absence of the extra "c."

IOW, I'm not convinced by the parent to which I'm directly replying and FreeReekingBeerMonk's reply, while presumptively accurate, doesn't address the use of a possibly erroneous path to find perl.exe.

Replies are listed 'Best First'.
Re^4: Strange problem with Windows 7 command line and perl
by pryrt (Monsignor) on Feb 13, 2017 at 00:58 UTC

    The problem is that the OP'd path excerpt not only had the \c\ version, which you are focusing on; it also had c:\strawberry\perl\bin, which is the full path used in the "that works fine" post, so if that really was the path, it should have been found.

    Unfortunately, we've only ever seen that original snippet of anonypl's "path variable", and do not know whether that was a copy/paste from the windows "Environment Variables" dialog box (and if so, whether it was from the user variables or system variables section), or whether that was a partial copy/paste from the actual cmd.exe prompt, with either a path or an echo %PATH% issued.

    I am curious whether powershell is finding the same perl executable that the full-path does from cmd.exe. If anonypl could run something similar to the following, we may learn more.

    cmd.exe C:\Users\pryrt>powershell Windows PowerShell Copyright (C) 2016 Microsoft Corporation. All rights reserved. PS C:\Users\pryrt> (get-command perl.exe).path c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\bin\perl.exe PS C:\Users\pryrt> exit C:\Users\pryrt>where perl c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\bin\perl.exe c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\bin\perl.exe C:\Users\pryrt>echo %PATH% ...;c:\usr\local\apps\berrybrew\perls\5.24.0_64\c\bin;c:\usr\local\app +s\berrybrew\perls\5.24.0_64\perl\bin;c:\usr\local\apps\berrybrew\perl +s\5.24.0_64\perl\site\bin;...

    And if you're wary of revealing something in your PATH, feel free to ellide, like I did. Or use the known location of perl to help you snip it, so we don't accuse you of deleting something helpful:

    c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\bin\perl.exe -le "pri +nt for grep { /perl/ } split /;/, $ENV{PATH}" c:\usr\local\apps\berrybrew\perls\5.24.0_64\c\bin c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\bin c:\usr\local\apps\berrybrew\perls\5.24.0_64\perl\site\bin

    Though on your system, you should use your known-good path to perl, which according to the aforementioned "works fine" post, should be as follows. Oh, right, and search for perl or berry:

    C:\Strawberry\perl\bin\perl\perl.exe -le "print for grep { /perl|berr +y/ } split /;/, $ENV{PATH}"

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1181868]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-10-25 11:23 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (89 votes). Check out past polls.