Previous in Forum: Linux Attacked by Windows Malware   Next in Forum: RTOS for embedded systems
Close
Close
Close
19 comments
Rate Comments: Nested
Active Contributor

Join Date: Oct 2008
Posts: 20

Perl problem

01/01/2009 3:30 AM

I have Strawberry Perl installed on my PC(Win98 OS).How do I get the command window for writing and executing the programs?

Register to Reply
Pathfinder Tags: perl stawberry perl
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#1

Re: Perl problem

01/01/2009 7:35 AM

I could answer more accurately but my Win98 machine is in the closet.

If you are able to get into Windows 95, 98 or ME, you can get to a MS-DOS prompt by following the below steps.

  1. Click Start
  2. Click Run
  3. Type "command" and press enter.

This will open a MS-DOS shell. However, if you are attempting to troubleshoot an issue with the computer and are using Microsoft Windows 95 or Windows 98we suggest you restart the computer into MS-DOS. To do this follow the below steps.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#2
In reply to #1

Re: Perl problem

01/02/2009 2:34 AM

Is perl programming possible in command prompt?I it is so, then whats the use of downloading the freeware?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#3

Re: Perl problem

01/02/2009 11:04 AM

Unless you are using a GUI based system (such as PerlTK) Perl is only available under a command prompt. The exception would be Load Management systems that are designed to organize Perl scripts.

The download (I'm not familiar with Strawberry) is for the interpreter and any tools they may have included.

But the appeal of Perl is it is text based so can be written without the overhead of a full Integrated Development Environment. You can write Perl in any text editor that doesn't add non-printing characters, (Notepad or Emacs or BBEdit vice Wordpad or Word).

One of the other appeals of Perl is it allows you to go around the API / DLL system of windows - so again, less overhead. And it is largely machine agnostic, so I can throw my Perl code to a Mac guy and he can run it.

AND it is easily incorporated into web based applications.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#4
In reply to #3

Re: Perl problem

01/03/2009 8:20 AM

Actually I am trying to learn Perl from the internet.Is there any reliable way of doing it?I tried many perl applications so that they can help me in practising programs in perl, but none of them were running in Win98 configuration.

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#5

Re: Perl problem

01/03/2009 9:11 AM

Unless you are trying to use Windows functions, the Win98, Win XP, Win 2K, Win NT are all beside the point. If you are, you are beyond my experience and I can't help.

Both sites Perl.org and Perl.com have a healthy support base, but for the beginner one of the most helpful starts is probably Perl for Dummies. Always a good reason for a trip to the library.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#6
In reply to #5

Re: Perl problem

01/03/2009 9:40 AM

Save this program as a file called first.pl:

use feature ':5.10';
say "Hi there!";

(The traditional first program says Hello world!, but I'm an iconoclast.)

Run the program. From a command line, go to the directory with this file and type perl first.pl. You should see:

Hi there!

I followed the above piece of text from the following link:-

http://www.perl.com/pub/a/2008/04/23/a-beginners-introduction-to-perl-510.html

As you said, I wrote the program in notepad,saved it as perl.pl according to text above.Now how do I "go to the directory with this file " for typing perl first.pl and hence see the output?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#7

Re: Perl problem

01/03/2009 10:16 AM

In Windows Explorer, find the "folder" with the file you created called first.pl

Try not to use the Desktop or any folder (like My Documents) since old DOS (like the Command window) hates long directory names or names with spaces.

So maybe under the directory for Perl ( maybe c:\Perl ) make a folder / directory called c:\Perl\Sandbox and put the file first.pl in there.

Now, going back to the Command Window use the command cd c:\Perl\sandbox You know you got there because the DOS prompt now says C:\PERL\SANDBOX

Now type perl first.pl and hit Enter.

Should work

Next, to make life easier in the future; go to the Desktop and right click and Create new shortcut.

Fish around in the tabs for one labeled command line or Cmd Line and put in (C:\WINDOWS\system32\command.com) OR if it brings up a wizard, insert the same thing. Click Browse to ensure it finds it, then cancel the Browse window.

If you have gotten this far, look for a place to insert a working directory. If you used the Wizard, skip this step and hit Finish. Windows will create a Desktop Icon that says MS-DOS prompt.

Right click the icon you just made and select Properties.

Now go find that Working Directory box, insert the location of your Perl directory, probably something like c:\Perl. You could also insert your new working directory c:\Perl\Sandbox. The Properties box will also allow you to rename the Icon - mine says Perl 5_10.

Now go to Wiki or elsewhere on the web and find the page for MS-DOS and print a handy list of the commands. For syntax (how to use it) any command can be typed into the command window after help, so help cd will display a list of ways to use the cd command and what each different way means.

Good luck!

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#8
In reply to #7

Re: Perl problem

01/04/2009 3:06 AM

It worked successfully till I got "c:perl\sandbox> " in the command prompt.Then,on writing "perl first.pl" it displays"Bad command or filename".What do I do now?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#9

Re: Perl problem

01/04/2009 7:47 AM

The directions are skinny, so don't get frustrated, it is just a path issue.

We forgot to tell Perl where to find first.pl

So either:

1. Move first.pl to your Perl directory (c:\Perl )

2. Or tell Perl where to find the file, type perl c:\perl\sandbox\first.pl

My fault, good luck

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#10
In reply to #9

Re: Perl problem

01/04/2009 3:08 PM

I moved first.pl inside perl folder which I had created in c drive.Now the perl folder contains a folder sandbox and perl.pl.The sandbox folder further contains perl.pl.I removed perl.pl from "My Documents" folder(where it got stored as I saved the file in noteped).I then faced the command window like this:-

c:\WINDOWS\Desktop>cd c:\perl\sandbox

c:\perl\sandbox>perl first.pl

Bad Command or Filename

c:\perl\sandbox>first.pl (this I tried since the previous was not working)

Bad command or Filename

Now is there any error or am I making another silly mistake?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#11

Re: Perl problem

01/04/2009 3:58 PM

Not silly, just not used to command line. You are getting it. Just off a step in the dance!

c:\perl\sandbox>perl first.pl

This command "stands" in the sandbox and "reaches" for Perl, it will work, but not with that command

c:\perl\sandbox>first.pl

Also sensible, but unfortunately wrong since we fail to "call" perl at all

Try this instead: stand in the Perl directory and "call" to your program

c:\perl> perl c:\perl\sandbox\first.pl

by telling Perl where to find it

Sorry I wasn't more clear, but you are getting the experiment until it works attitude that you need!

Hang in there!

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#12
In reply to #11

Re: Perl problem

01/05/2009 2:17 AM

First of all thanks for your encouragement.Armed with new knowledge I faced the command window like this:-

c:\WINDOWS\Desktop>cd c:\perl (got into perl folder as you said)

c:\perl> perl c:\perl\sandbox\first.pl

Bad Command or Filename

(Since the above didnt work,I tried to go into sandbox while being in perl)

c:\perl>cd c:\sandbox

Invalid Directory

(Now I thought that since perl also contains first.pl along with sandbox,so try to reach to first.pl without touching sandbox)

C:\perl>perl c:\perl\first.pl

Bad Command or Filename

So how do I proceed now?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#13

Re: Perl problem

01/05/2009 8:58 AM

Hmmmm,

OK, very confusing.

I have a seperate directory called C:\perlwork as you can see parallel to my C:Perl directory, not as a subdirectory to C:\Perl.

So first I tried your commands to see if I could duplicate the errors.

When I try to use the sandbox (which I know I do not have) it tells me:

Can't open Perl script "c:\perl\sandbox\first.pl": No such file or directory

But notice, the system IS calling Perl (Can't open Perl script) but then telling me it can't find the file (because there is no such file there.)

In your case, your message sounds more like it isn't finding the Perl installation at all.

Go back to an Explorer window and examine your Perl directory to ensure it was unpacked correctly.

With differences for my installation and Strawberry you should have a Bin subdirectory, probably a Lib, a Man, perhaps an eg. More is OK, but ensure you have Bin.

Within the Bin subdirectory you should find at a minimum Perl5.10.0.exe (maybe not - that is a lot of "."s for Win98) but at least a couple of files with .exe extensions.

I suspect an install problem with Perl at this point.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#14
In reply to #13

Re: Perl problem

01/05/2009 3:33 PM

I found Strawberry folder in c drive.Inside it I get c,cpan,liscense,perl,win32 and unins000.

Ventured into "c",found bin,lib,share etc.Inside bin,got no .exe or Perl5.10.0.exe but found exe_update,exe_update.pl and exetype.

So,tried reinstalling from the setup(without deleting anything), but got no improvement.

Does that mean Strawberry isn't reliable?If so and otherwise also please recommend any other secure source from where I can get a proper download considering my win98 system.

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#15

Re: Perl problem

01/05/2009 4:36 PM

I get c,cpan,liscense,perl,win32 and unins000.

The structure of directories is quite common; try dipping into the Perl directory and see if it has a similar structure.

Specifically see if you have: perl\bin\ any .exe files

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#16

Re: Perl problem

01/05/2009 8:13 PM

I should have left you somewhere to go from there;

If you get into the Perl folder and find Perl(version).exe all will be OK

If you get into the Perl directory and find (Name)Perl.msi you are not quite done installing. For instance I use ActivePerl and my installation package is called ActivePerl.msi. I'm suspecting yours may be StrawberryPerl.msi or something similar.

From anywhere (any directory) within the command window you should be able to type perl -v, and it should come back with the Perl version installed, and perhaps a use/license statement.

If that won't work, perhaps we have a problem.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#17
In reply to #16

Re: Perl problem

01/06/2009 6:28 AM

I checked all the files and found various extensions like ".pl",".pm",".pod" etc., but not any ".exe" or any ".msi".

Secondly, I tried the command window like following:-

c:\perl>perl -v

Bad command or filename.

I think that there is a problem in the software itself since I encountered no error while installing Strawberry.Now, is it worthwhile that I uninstall this Strawberry and download some other?Is there any other download available that would get perl running successfully on my win98?

Register to Reply
Guru
Engineering Fields - Systems Engineering - New Member Popular Science - Weaponology - New Member

Join Date: Jun 2006
Location: Borrego Springs
Posts: 2636
Good Answers: 62
#18

Re: Perl problem

01/06/2009 7:08 AM

All of your suggestions are possible, as I said I use a distribution from ActivePerl that seems solid.

Or try Strawberry on Perl.org's forums.

I kind of liked what I saw of Strwberry's site and what they say about their environment sounds good.

__________________
"If you want to get somewhere else, you must run at least twice as fast as that!"
Register to Reply
Active Contributor

Join Date: Oct 2008
Posts: 20
#19
In reply to #18

Re: Perl problem

01/13/2009 2:40 PM

I am trying to find a compatible perl application.meanwhile if have any doubts in theory, I will come back to you.Well is there any good source of learning perl theoretically on the net which can explain perl in a lucid manner?

Register to Reply
Register to Reply 19 comments

Previous in Forum: Linux Attacked by Windows Malware   Next in Forum: RTOS for embedded systems

Advertisement