in reply to Perl On Win 98

At the command prompt type this:
perl hello.pl
Your script is just a text file, it's not executable.

Replies are listed 'Best First'.
Re: Re: Perl On Win 98
by thunders (Priest) on Jan 09, 2002 at 21:52 UTC
    Your script is just a text file, it's not executable.
    I'd have to disagree with that statement.
    Yes, it is a text file, but on most flavors of windows, the file association should be made when perl is installed(this is true with an ActiveState Installer). This file will not be opened by a text editor if clicked. It will be opened by "perl"(right clicking will present other options).
    Therefore on a command prompt:
    C:\>myscript.pl
    should work. It also means that double clicking on a file will open a command prompt and cause the program to be executed by the perl interpreter "perl.exe". if this is not the case you can set associations up in:
    My Computer->View->Options...->File Types
    of course perl myscript.pl is preferable becase it allows you to specify all the nifty command line options
      thunders - you're completely correct about how the ActiveState installer associates the 'pl' extension with perl.exe by default. But that's not the same thing as making files with a 'pl' extension truly executable.

      Notice that Paul says he tried typing the script name at the DOS prompt and got a "bad command or filename" in response.

      Double-clicking the file in Windows Explorer causes the filename to be sent to the perl.exe program, which then tries to parse and execute the code in the file. On my Windows machine, the command that Explorer issues when I double-click on a *.pl file is this:

      C:\Perl\bin\Perl.exe "%1" %*
      You mentioned the Windows 'File Types' dialog - while you're there, find 'Perl file', click 'Edit' - select the 'Action' called 'open' and click 'Edit'. Here's where you'll see that command line.