in reply to Strange problem with Windows 7 command line and perl

Hi

I did start a new instance of command line still the problem persisted. After that, I rebooted and tried again, but the problem was still there. As stated earlier, I dropped to PowerShell and it worked. But the moment I get out of PowerShell, it stops working.

C:\Users\pmu>perl 'perl' is not recognized as an internal or external command, operable program or batch file. C:\Users\pmu>powershell Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved. PS C:\Users\pmu> perl --version This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x +86-multi-thread-64int Copyright 1987-2017, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. PS C:\Users\pmu> exit C:\Users\pmu>perl 'perl' is not recognized as an internal or external command, operable program or batch file. C:\Users\pmu>

This is something that I truly do not understand. Things are pretty straightforward in linux. I just have to edit the $PATH variable and things generally work consistently.

Replies are listed 'Best First'.
Re^2: Strange problem with Windows 7 command line and perl
by NetWallah (Canon) on Feb 13, 2017 at 04:08 UTC
    Using the "Name" give by your association:
    >assoc .pl .pl=Perl_program_file
    Check your registry by running :
    >reg query "HKEY_CLASSES_ROOT\Perl_program_file\shell\Execute Perl Pro +gram\command"
    Mine shows:
    HKEY_CLASSES_ROOT\Perl_program_file\shell\Execute Perl Program\command (Default) REG_SZ C:\Strawberry\perl\bin\perl.exe "%1" %*
    This will locate the perl binary that ran your ".pl" script.

    After that, you need to make sure it is in the PATH.

            ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall