Strawberry

S

sanozuke

I have a Windows Xp and use Strawberry the think is the hello word
doesn't work, and then the others programs as well.
I do "perl filename.pl" in the command line and it gives a error
unknow shell command.
Don't know what to do.
Ray
 
B

brian d foy

sanozuke said:
I have a Windows Xp and use Strawberry the think is the hello word
doesn't work, and then the others programs as well.
I do "perl filename.pl" in the command line and it gives a error
unknow shell command.

As with any other command, the path to it must be in the Windows search
path. Can you execute the program with the full path to perl?

C:/path/to/perl script.pl
 
M

Mirco Wahab

brian said:
As with any other command, the path to it must be in the Windows search
path. Can you execute the program with the full path to perl?

C:/path/to/perl script.pl

The actual Strawberry 5.10.x (exe-installer) version
puts itself into %SystemDrive%\strawberry\perl\bin and
adds two locations to the Windows path (e.g., if the
system drive is C):

C:\strawberry\perl\bin;C:\strawberry\c\bin;

During the install, there is no option to
modify or to skip that step. Maybe there's
only a reboot of the Windows XP required.

Regards

Mirco
 
A

A. Sinan Unur

The actual Strawberry 5.10.x (exe-installer) version
puts itself into %SystemDrive%\strawberry\perl\bin and
adds two locations to the Windows path (e.g., if the
system drive is C):

C:\strawberry\perl\bin;C:\strawberry\c\bin;

During the install, there is no option to
modify or to skip that step. Maybe there's
only a reboot of the Windows XP required.

A reboot should not be necessary but changes in environment variables will
not be propagated to already open cmd.exe windows.

Out of curiosity, I downloaded Strawberry Perl. I was a little
disappointed that it would not let me install in a different location (I
put certain stuff in c:\opt to avoid paths with spaces) but I guess I
could live with that.

The installer put

C:\strawberry\perl\bin;C:\strawberry\c\bin;

at the end of %PATH%. Well, that is not going to work for me (I have quite
a few Perl installations at the moment). So, I fired up a cmd prompt:

C:\Temp> set PATH=C:\strawberry\c\bin;C:\strawberry\perl\bin;%path%

C:\Temp> perl -V
....
Built under MSWin32
Compiled at Apr 17 2008 11:36:20
@INC:
C:/strawberry/perl/lib
C:/strawberry/perl/site/lib
 
J

Jürgen Exner

sanozuke said:
I have a Windows Xp and use Strawberry the think is the hello word
doesn't work, and then the others programs as well.
I do "perl filename.pl" in the command line and it gives a error
unknow shell command.

Then perl.exe is not in your search path.
Don't know what to do.

Add perl.exe (actually the directory that contains perl.exe) to your
search path or use a fully qualified path to access perl.exe

jue
 
S

sisyphus

.
.
I was a little
disappointed that it would not let me install in a different location (I
put certain stuff in c:\opt to avoid paths with spaces)

Yes - that's one of the things I would like to see fixed in
Strawberry. However, if you wanted, it's not such a big deal to
relocate it.
Just copy the whole lot over to c:\wherever and then replace (in
Config.pm and Config_heavy.pl) every occurrence of c:\strawberry with
c:\wherever.

Then amend the path settings appropriately and you should be done.

Cheers,
Rob
 
S

sanozuke

Do I put it(#!/usr/bin/perl ) on the strawberry scripts or is a
diferent shebang line?
 
J

Jürgen Exner

sanozuke said:
Do I put it(#!/usr/bin/perl ) on the strawberry scripts or is a
diferent shebang line?

If your Perl interpreter resides in /usr/bin/perl, then that is the
correct line. If it resides in a different place then use the path to
that place.

jue
 
J

Jürgen Exner

Dr.Ruud said:
Jürgen Exner schreef:

On Windows, that doesn't necessarily work that way.

Well, big surprise there. Of course Windows doesn't use the shebang line
in the first place but relies on bindings of the file extension instead
to achive the same goal.

jue
 
D

Dr.Ruud

Jürgen Exner schreef:
Dr.Ruud:

Well, big surprise there. Of course Windows doesn't use the shebang
line in the first place but relies on bindings of the file extension
instead to achive the same goal.

Still, the shebang line is valid for its flags, like -T.
And it's good to be able to use the same version of a script on multiple
platforms, without the need to change the shebang line.
 
S

sanozuke

I put in the command line perl hello.pl and perl perl40.pl and a pop
up very quicly appear's, just show up and don't gives time to see
anything.
What is that is going wrong
 
R

RedGrittyBrick

sanozuke said:
I put in the command line perl hello.pl and perl perl40.pl and a pop
up very quicly appear's, just show up and don't gives time to see
anything.
What is that is going wrong

Without knowing the contents of the hello.pl or perl40.pl, which you are
hiding from us, I can only guess.

What is in hello.pl?
 
A

A. Sinan Unur

Without knowing the contents of the hello.pl or perl40.pl, which you
are hiding from us, I can only guess.

And my guess is the OP is not running the programs from the cmd shell
command line but instead typing

perl hello.pl

in Start -> Run

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
R

RedGrittyBrick

A. Sinan Unur said:
And my guess is the OP is not running the programs from the cmd shell
command line but instead typing

perl hello.pl

in Start -> Run

Ah yes. In which case the OP might want to add to the end of the
programs something not entirely unlike:

print "Press the enter key to finish: ";
my $farewell = <>;
 
A

A. Sinan Unur

....


Ah yes. In which case the OP might want to add to the end of the
programs something not entirely unlike:

print "Press the enter key to finish: ";
my $farewell = <>;

That would not work if perl cannot locate hello.pl which is likely to
happen if one runs

perl hello.pl

from Start -> Run (without providing the full path to hello.pl)

I thoroughly recommend opening a cmd.exe shell and testing command line
programs from the command line in that shell.

The Command Prompt Here power toy as well as Console2 make life simpler.

Sinan


--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
B

Brian Helterlilne

RedGrittyBrick said:
Ah yes. In which case the OP might want to add to the end of the
programs something not entirely unlike:

print "Press the enter key to finish: ";
my $farewell = <>;

It's better to wrap that in a BEGIN block so you see any compilation
errors as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top