| Home | “Better to go to http://perldoc.perl.org/ for your Perl documentation.” |

Tutorial: How to Program in Perl on Your Windows Computer

By Howard Charles Best, May 12, 2006

(LLBest.com, )

Major update: July 4, 2009

Remember when the IBM PC first came out, and you used “BASICA” or “GWBASIC” to do “just about anything?” Later on, “Borland Turbo Pascal” became very popular because it was even more powerful, and it was much faster because it was a compiler instead of an interpreter.

Now you can use Perl to do “just about anything,” and it’s a free program! Perl is also very fast because it’s also a compiler. However, it has the advantages of an interpreter because you don’t have to bother with any complicated command lines or intermediate files. (No more .obj files, .tsd files or space hungry .exe files to contend with!) It compiles the source code in the “wink of the eye” at run time!

Note: This tutorial assumes that the extensions for known file types are not hidden: a) Click Start. b) Click Computer. c) Click Organize. d) Click Folder and search options…. e) Click the View tab. f) Make sure that Hide extensions for known file types is unchecked. g) Click OK. h) Close the Computer window.

 

TESTING PERL, PART 1

1. Create a text file by right clicking your desktop and selecting New / Text Document.

2. Double-click the newly created New Text Document.txt file’s desktop icon to open it in Notepad.

3. Copy / paste the following text into New Text Document.txt:

4. Close Notepad, saving the file.

5. Rename New Text Document.txt to HelloWorld.bat.

6. Double-click the HelloWorld.bat icon, and, because Perl is not yet installed, a DOS window containing the following should appear, indicating that the test was only a partial success:

Screen dump of test, part 1

 

DOWNLOADING PERL

7. Go to http://www.activestate.com/Products/ActivePerl/ and click ActivePerl DOWNLOAD NOW:

Screen dump of download,part 1

8. For FireFox, the download should look something like this:

Screen dump of download, part 2

 

INSTALLING PERL

9. Double click the following newly downloaded file in order to begin installing Perl:

Screen dump of install, part 1

10. Click Next >.

11. Select I accept… & click Next >.

12. Click the down arrow for ActivePerl and click Entire feature will be unavailable. Now it should look something like the following:

Screen dump of install, part 2

13. Click the + sign.

14. Click the down arrow for PerlEx and click Will be installed...

Screen dump of install, part 3

You may be tempted to also select Documentation, but don’t. The documentation is not very good, it takes up an additional 28 MB on your hard drive, and it slows down the installation process considerably. The installation is surprisingly slow even without installing the documentation. Better to go to http://perldoc.perl.org/ for your Perl documentation.

15. Now it should look something like this:

Screen dump of install, part 4

16. Click Next >.

17. Uncheck both options:

Screen dump of install, part 5

18. Click Next >.

19. Click Install.

20. Click Finish.

21. Now your drive C root directory should look something like this (The Perl folder has been added):

Screen dump of install, part 6

22. Rename Perl to usr. This is to make your Perl installation compatible with the rest of the tutorials on this website. The original reason for the rename was to make the local installation compatible with typical web servers for local testing of Perl .cgi web pages using XAMPP.

Screen dump of install, part 7

 

TESTING PERL, PART 2

23. Again double-click the HelloWorld.bat icon on your desktop. This time it should work:

Screen dump of test, part 2

Now you are ready to begin programming in Perl!


| Home | THIS WEB PAGE URL: http://llbest.com/?P=5f |