Question

I am immersing myself into the world of Perl for the first time. I figured the easiest way was to integrate using notepad++, which is my preferred editor. I went ahead and installed the ActiveState self extracting installer. I then pointed NppExec to my perl directory by typing:

perl "$(FULL_CURRENT_PATH)"

As a script "Run Perl", saved, then added a macro using this procedure

http://paul.atc.informatica.gsf.nl/resources/Perl_with_Notepad.pdf

I can run Perl scripts using the perl compiler. However, perldoc does not work erroring with:

Can't locate object method "perldoc" via package "perldoc" (perhaps you forgot to load "perldoc"?) at C:\Users...

This is because my perldoc and compiler are actually in c:\perl\bin (or whatever)

How do I switch the file path to point to the right directory? Thank you so much. I am a complete noob at this.

Edit: To add more information, perldoc works fine if i call

perldoc perldoc

using the command prompt. It does not work when i write a script in notepad++ and attempt to complile. Both the cmd prompt and notepad++ will compile scripts correctly.

Was it helpful?

Solution

Perldoc is not a part of the Perl language. It is a program that is part of the core distribution. You'll likely find a perldoc.bat in your ActivePerl install if you look for it.

So that's why:

 perldoc perldoc

works from the command line (because that's how it is intended to be invoked. But fails miserably when you ask Perl to execute 'perldoc' command. It tries valiantly to find a method, defined somewhere in all of the modules that have been included, but finding none, tells you so.

So if you want to write a Perl program to execute perldoc, you could use something like this:

  print `perldoc perldoc`

But you're much better off using a bat file, or its equivalent in your version of windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top