Closed Thread Icon

Topic awaiting preservation: Perl installation headache (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12563" title="Pages that link to Topic awaiting preservation: Perl installation headache (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Perl installation headache <span class="small">(Page 1 of 1)</span>\

 
Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 12-27-2002 14:34

OK, I'm new to programing but i've got this book on perl. I'm running windows 2000 so i've downloaded ActivePerl from the activestate website and doubleclicked the installer. A perl folder had been installed on c:\ . Now what? the book tells me to open a DOS or command prompt window to type my code into. how do i get one of those?


~We're not here for long, we're here for fun~

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 12-27-2002 15:28

It's probably in Start > Programs > Accessories > Command Prompt...

But you can get there quicker by using Start > Run to run the program command.

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 12-27-2002 15:50

Or if you're on a NT / 2000 / XP machine you'll have to type cmd instead...

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 12-27-2002 20:01

Thanks guys, thats done it. daresay i'll be back here for more info


~We're not here for long, we're here for fun~

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 12-27-2002 21:05

Au contraire, Kuckus, I'm running 2000 and "command" worked also. Perhaps one is an alias of the other? Anyway, use one or the other and you'll be fine.

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 12-28-2002 03:28

ok, ive been at it all night and i still cant get this sucker to run. a 1 line script typed directly into the command prompt window returns the correct result. but now i've saved it as a seperate .pl file created in notepad and stored on the C disk so i presume the file path is C:\hello.pl and the file reads:

#!c:\perl\bin\perl -w

print "hello, world!\n";

in the cmd prompt window I have a C:\> waiting but no matter what i type in I get error messages and access denied messages so what the heck am i doing wrong??


~We're not here for long, we're here for fun~

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 12-28-2002 13:25

ok, what exactly are you typing into the command line?

... because shebang lines are usually only good on webservers and unix systems..

remember that you need to type it like this in the command line:

c:\DirectoryWhereYourScriptIs>perl myScript.pl

in your case it would be:

C:\>perl hello.pl

... and since you mentioned cmd I'm going to assume you're using an NT or XP system- and on said systems you need to make sure you have (a) the permissions to access the command line or (b) permissions to access the root directory directly or (c) you need to be logged in as Administrator...

... and I'm not sure if there's supposed to be double-quotes around the print statement, but if you run the script correctly -and it's full of garbage- careful examination of the error messages will deduce your exact mistakes..

...post here if you get it..


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 12-28-2002 13:36

Perfect T: Now that's news for me, but it really seems to work. I'm still saving some 4 key strokes though

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 12-28-2002 21:50

Petskull, after the prompt (C:\> ) i typed in:
perl hello.pl
and the response was;

Can't open perl script "hello.pl": No such file or directory

the shebang is not required in windows but the book i'm reading advises you to use it in case the script ever does get used on a unix system. I'm using windows 2000 pro but I don't understand this business of permissions. On boot up i'm asked for an administrator password but have always ok'd this without filling in the field.
double quotes are required in windows


~We're not here for long, we're here for fun~

[This message has been edited by Morph (edited 12-28-2002).]

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 12-30-2002 06:56

stupid question: is there a 'hello.pl' in your root directory?

barring that- maybe a problem with your paths?



Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 12-30-2002 16:25

just a trivia fact:
Command.com is the old dos shell, which still exists under win xp.
cmd.com is the command line shell of NT technology windoses (ie. NT 4.0, 2000, XP). It handles things like long file names much better.

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 12-31-2002 16:07

When I open C there are various folders of which one is perl. also on C i have the document called hello.pl

Im not 100% certain what is meant by root directories. am i on the right track here?


~We're not here for long, we're here for fun~

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 01-01-2003 17:22

what is mean by 'root' is the upper-most directory..

..on Windows machines it's usally C:\>


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 01-02-2003 07:45

In that case then yes, both perl and hello.pl are in my root directory


~We're not here for long, we're here for fun~

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 01-03-2003 07:50

SORTED!
after the Cprompt I typed,
C:\Perl\bin\perl.exe hello.pl
and it worked.
my only question now would be do I have to keep my perl scripts loose on the C disk in order for them to be found? I tried to put hello.pl in a folder on C but it didn't work. Also I noticed that although I wrote the script in notepad it was actually saved as hello.pl.txt
I know you can stop the txt extention being added but off the top of my head I can't remember how


~We're not here for long, we're here for fun~

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 01-03-2003 16:17

Issue #1: Damnit- I knew it was the paths... but I haven't been able to find out where to change the path on a WinXP box-- try putting set PATH = c:\Perl\bin\;%path% in your c:\autoexec.bat file?

Issue #2: On Notepad, select All Files in the Save as type: box on the Save As... dialog and it will stop adding the '.txt' to the files you save

when all that is squared away, you should be able to simply go the the directory with the script and type perl and the filename..

eg.

C:\mykewlscripts\perl neatoscript.pl


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Morph
Paranoid (IV) Inmate

From: The Soft Cell
Insane since: Nov 2001

posted posted 01-03-2003 19:29

I opened C and found the AUTOEXEC.BAT file but it is dimmed and when I double click it I get a message saying this is not a valid Win32 application. There is an autoexec.nt file in C:\WINNT\repair and one also in C:\WINNT\system32. should I attempt to open one of these via notepad and make the changes you suggested?


~We're not here for long, we're here for fun~

MeTAlMollY
Nervous Wreck (II) Inmate

From:
Insane since: Jul 2001

posted posted 01-03-2003 19:54

Hello Morph,

Instead of editing the autoexec.bat do the following:

Right Click the "My Computer" icon on your desktop.
Select "Properties" from the context menu.
Select "Advanced" tab and press the "Environment Variables" button.

Now select "Path" which can be found under the system variables. Select Path so that it is blue and press the Edit button. In the dialog, you ADD the following at the end of the Variable Value field, so don't delete the old values:

;c:\perl\bin -> don't forget the ; !! Something like this:

Variable Name: Path
Variable Value: blablabla;blabla;c:\perl\bin

Now restart you system and try running the hello.pl again.

I had the same problem when installing ActiveState on my machine...

« BackwardsOnwards »

Show Forum Drop Down Menu