I am new to the perl language and had just started reading the book "Perl5 by example" by David Meddinets.However in the very first chapter he says that you need to try out the programs on a perl interpreter.I have w98 and have downloaded the asi version of 5.8.7 from activestate.com and extracted using winzip.I also get the reply at command prompt after typing perl -v.I have made the addition of .pl in openwith command.I get the perl icon when i designate a script as ".pl".But When i try to run the perl script using c:\activeperl\perl\bin\perl.exe (which contains the basic print command),i get an error as " cannot open the perl script:myfile.pl:no such file or directory".Also i cannot run cmd on run of w98.What is the difference between perl script and perl module.Where can i get perl tutorials especially for win 98(I found a hellalot tuts for unix which i donot require).Please help me out.

Dani AI

Generated

Brief summary and practical checks (building on and ): the "cannot open the perl script... no such file or directory" message means perl cannot find the file given. On Windows 98 that usually comes from a wrong current directory/drive, a filename saved with a hidden .txt suffix, paths that contain spaces and lack quotes, or from using the zip build without running the installer that adjusts associations and the environment.

Quick verification and run steps (Win98 specifics — command.com, not cmd.exe): open the MS‑DOS Prompt (Start → Programs → Accessories → MS‑DOS Prompt) or Start → Run → type command. From the prompt confirm the script is visible with dir, change to the correct drive, then run perl with explicit paths and quotes if needed. Example:

C:\> D:
D:\> cd \projects\perl
D:\projects\perl> dir myfile.pl
D:\projects\perl> C:\ActivePerl\perl\bin\perl.exe "myfile.pl"

File‑association and installer notes: the installer normally sets PATH and the .pl association so double‑clicking passes the script name and any arguments. If associating manually via Explorer, point the association at perl.exe and ensure the command line will include the script filename (so perl actually receives "scriptname"). Also confirm the editor saved the file as myfile.pl (not myfile.pl.txt).

Brief note on script vs module: a script (.pl) is a runnable program. A module (.pm) is a reusable package loaded with use Module::Name; and placed on Perl’s library path; modules must return true (commonly 1;) at the end.

Recommended Answers

All 2 Replies

I believe the installer.bat file (a perl script) does a lot of file path renaming in various scripts in the perl installation. Using perl without running installer.bat is problematic. You also may need to specify the full path for unless it is in your current directory (while in a DOS command window).

Kordaff

Yes, Using the installer is the best way to go. I've found that the later versions don't seem to require a lot of command line working (in 98) for the install, but that's been my experience.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.