http://qs321.pair.com?node_id=11100241


in reply to Re: Can't find or uninstall version of perl
in thread Can't find or uninstall version of perl

That's really strange. Why would "which" work at all if it doesn't come standard. I'm not, to my knowledge, using cygwin or anything like it. I have installed git, github, and various python utilities -- could one of those have brought "which" into the system?

Replies are listed 'Best First'.
Re^3: Can't find or uninstall version of perl
by AnomalousMonk (Archbishop) on May 19, 2019 at 08:55 UTC
    I have installed git, github, and various python utilities ...

    Pythonista gits tend to like *nix-ish utilities, so I wouldn't be surprised if one of those installs smuggled the Windows port of the GNU utilities aboard. From my Windows system:

    c:\@Work\Perl\monks>which which.exe c:\UnxUtils\wbin\which.exe


    Give a man a fish:  <%-{-{-{-<

      And git on Windows comes with its own perl, which on my system is version 5.26.2. That would explain the extra perl in the path.

      ScarletObsidian: where perl will list the location of all the perls in your path, and I would assume one will be under git's usr/bin subfolder. And now I think of it, if you are running the git console then calling which perl will list /usr/bin/perl, which is what you reported in your first post.

Re^3: Can't find or uninstall version of perl (git-bash / perldoc / %INC)
by LanX (Saint) on May 19, 2019 at 14:37 UTC
    Are you using the git-bash console ?

    There you'll have which and a Perl installation and Unix paths notation.

    That doesn't effect the normal cmd.exe unless you change PATH to point to the git utilities. ( I never tried this)

    Anyway perldoc -l MODUL will point you to your Perl's installation directory.

    For instance the doc location of a core module like warnings always works.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

    update

    s/-t/-l/

    update

    Fired up my Win box and inside cmd.exe it works

    D:\>perldoc -l warnings C:\Perl_524\lib\warnings.pm

    But seems that git-bash comes without perldoc

    $ perldoc -l warnings Can't locate Pod/Perldoc.pm in @INC ...

    But the following works on both variations, provided you swap ' and " accordingly for cmd.exe

    $ perl -Mwarnings -e 'print $INC{"warnings.pm"}' /usr/share/perl5/core_perl/warnings.pm

    D:\>perl -Mwarnings -e "print $INC{q'warnings.pm'}" C:/Perl_524/lib/warnings.pm
    ANYWAY DON'T TRY TO UNINSTALL git's Perl.
Re^3: Can't find or uninstall version of perl
by syphilis (Archbishop) on May 19, 2019 at 12:55 UTC
    I'm not, to my knowledge, using cygwin or anything like it.

    But you do have Cygwin or something like it (maybe msys ?). Nothing else is going to report a path that begins with "/usr/bin".

    I have both Cygwin and Msys:
    C:\>which which 'which' is not recognized as an internal or external command, operable program or batch file. C:\>set PATH=C:\_64\msys64\usr\bin;%PATH% C:\>which which /usr/bin/which C:\>
    and, for Cygwin:
    C:\>which which 'which' is not recognized as an internal or external command, operable program or batch file. C:\>set PATH=C:\cygwin\bin;%PATH% C:\>which which /usr/bin/which C:\>
    Cheers,
    Rob

      I took a look at my path variable. Turns out I have something called MinGW, so MINimalist Gnu for Windows, installed. It shows up right after Brackets' Path entry and before a whole stack of earlier Strawberry perl entries.

       which which returns:  usr/bin/which

       which perl returns: usr/bin/perl

      perl -e "print$^X" returns: perl

      Note, this is only true if I open a default windows terminal; if I use the portable shell executable packaged with portable Strawberry perl, which perl gives me the correct file path (to my desktop, atm, where I unpacked portable Strawberry perl).

Re^3: Can't find or uninstall version of perl
by Anonymous Monk on May 19, 2019 at 07:39 UTC
    which which