Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Can't find or uninstall version of perl

by swl (Vicar)
on May 19, 2019 at 07:12 UTC ( #11100240=note: print w/replies, xml ) Need Help??


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

/usr/bin/perl is not a standard Windows path, and which is not a standard Windows utility.

Are you using cygwin or similar for the console? If so then the other perl will be somewhere in its directory structure, and should probably be left alone (particularly since you have a working solution using the portable Strawberry perl - 11100238).

Replies are listed 'Best First'.
Re^2: Can't find or uninstall version of perl
by ScarletObsidian (Novice) on May 19, 2019 at 07:33 UTC
    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?
      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.

      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.
      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).

      which which

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-01-29 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?