Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have Perl 5.10 for Windows Vista. After installation I ran both the "hello world" and "perl -v" successfully. Testing to see if LWP was installed I ran: % perl -MLWP -le "print(LWP->VERSION)" I received this message: "% is not recognized as an internal or external command, operable program or batch file." Receiving the same message on the very few other simple scripts I have tried to run. Thanks
  • Comment on % o $ is not recognized as an internal or external command

Replies are listed 'Best First'.
Re: % o $ is not recognized as an internal or external command
by kyle (Abbot) on Aug 18, 2008 at 15:55 UTC

    What happens if you try it without the leading percent sign? (The percent sign is a common prompt on a lot of UNIX systems. It's not really part of the command.)

      It returned the following: 5.812 The % perl _MLWP _le "print(LWP->VERSION)" script came from the Book by Sean M. Burke titled "Perl&LWP. Thanks!
Re: % o $ is not recognized as an internal or external command
by FunkyMonk (Bishop) on Aug 18, 2008 at 15:57 UTC
    You typed % ... at the command prompt?

    If so, Vista is trying to run a program called "%", which is probably not what you want. Try it again without the percentage sign.

Re: % o $ is not recognized as an internal or external command
by Anonymous Monk on Aug 18, 2008 at 17:35 UTC
    Without the percent sign it returned: 5.812 The script "% perl -MLWP -le "print(LWP->VERSION)" came from the book by Sean M. Burke titled Perl & LWP. Thanks
      In most of my Perl books, the author will preface a command with a prompt like $, #, or %. When you're new to Perl, it can be confusing. What the author meant was

      perl -MLWP -le "print(LWP->VERSION)"

      On the other hand, when I run

      % perl -MLWP -le "print(LWP->VERSION)"

      bash will come back at me with "no such job". Obviously, we didn't want a job, but we wanted the version number of LWP.
      Another way to find the version number is to use pmvers from pmtools. Just run:

      pmvers LWP

        They also explain whats a prompt, like: The dollar sign (and space) at the start of the line represents the shell prompt, which will probably look different on your system.