WIN32 PPM and perldoc problems

J

jovo.miskin

I ahve installed Active Perl v5.8.7 build 813 on WindowsXP machine.

Executing PPM gives this output:
C:\Perl\bin>ppm
Unknown or ambiguous command '*'; type 'help' for commands.

C:\Perl\bin>

Executing perldoc gives this output:
C:\Perl\bin>perldoc
Usage: perldoc.bat [-h] [-V] [-r] [-i] [-v] [-t] [-u] [-m] [-n
nroffer_program]
[-l] [-T] [-d output_filename] [-o output_format] [-M
FormatterModuleNameToUse]
[-w formatter_option:eek:ption_value] [-F] [-X]
PageName|ModuleName|ProgramName
perldoc.bat -f PerlFunc
perldoc.bat -q FAQKeywords

The -h option prints more help. Also try "perldoc perldoc" to get
acquainted with the system. [Perldoc v3.14]

C:\Perl\bin>perldoc -f gmtime
Syntax error
Bad command or file name

C:\Perl\bin>

I've tried reinstalling Active Perl a few times, but the problem
persisted.

Any idea, what is wrong in my setup, preventing these utlities to
execut properly ?

Thanks in advance !
 
J

jl_post

C:\Perl\bin>perldoc
perldoc.bat -f PerlFunc
perldoc.bat -q FAQKeywords

C:\Perl\bin>perldoc -f gmtime
Syntax error
Bad command or file name

I've tried reinstalling Active Perl a few times, but the problem
persisted.

This is just a suggestion, but have you tried running perldoc with
the ".bat" extension as mentioned in the output of "perldoc"?

I would try the command:

C:\> C:\Perl\bin\perldoc.bat -f gmtime

and see if that helps.

I hope something works...
 
J

jovo.miskin

I've tried it. The output is the same.
C:\Perl\bin>perldoc.bat -f gmtime
Syntax error

C:\Perl\bin>

I beleive, that both problems, perldoc and ppm are of the same nature
concerning
some sort command line interpreter compatibility issue.

This is ppm output:
C:\Perl\bin>ppm
Unknown or ambiguous command '*'; type 'help' for commands.

C:\Perl\bin>
 
B

Ben Morrow

Quoth (e-mail address removed):
I've tried it. The output is the same.
C:\Perl\bin>perldoc.bat -f gmtime
Syntax error

C:\Perl\bin>

I beleive, that both problems, perldoc and ppm are of the same nature
concerning
some sort command line interpreter compatibility issue.

This is ppm output:
C:\Perl\bin>ppm
Unknown or ambiguous command '*'; type 'help' for commands.

My (wild, unsupported) guess from this is that your .BAT association has
got messed up. It should look something like (from memory)

c:\winnt\system32\cmd.exe "%*"

: is the % missing?

Ben
 
J

jovo.miskin

Ben said:
Quoth (e-mail address removed):

My (wild, unsupported) guess from this is that your .BAT association has
got messed up. It should look something like (from memory)

c:\winnt\system32\cmd.exe "%*"

: is the % missing?

Ben

--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. (e-mail address removed)

Ben,

The .BAT association is, I beleive, fine. I have a number of Windows XP
machines, not suffering from ths problem, and a few machine exhibiting
this problem. All
of them have .BAT association set in the same way with "%1" %*.

Jovo
 
J

jovo.miskin

The problem seem to be specific to passing arguments to system call.

Let' say we create a perl script called sys_args.pl that contanis the
next two lines:
#my $opt_exe = "ppm3-bin";
system($opt_exe, @ARGV);

And also we add at the top of ppm3-bin next two lines:
my $numargs = scalar @ARGV;
print "in ppm3_bin, numargs = $numargs\n";

The command line
sys_args.pl
produces output
in ppm3_bin, numargs = 1

The command line
sys_args.pl 1 2 3
produces output
in ppm3_bin, numargs = 1

Jovo
 
D

Dr.Ruud

(e-mail address removed) schreef:
I ahve installed Active Perl v5.8.7 build 813 on WindowsXP machine.

Executing PPM gives this output:
C:\Perl\bin>ppm
Unknown or ambiguous command '*'; type 'help' for commands.


Try these:

C:> assoc .pl
C:> ftype Perl
C:> assoc .bat
C:> ftype batfile

I get these answers:

..pl=Perl
Perl="C:\Perl\bin\perl.exe" "%1" %*
..bat=batfile
batfile="%1" %*
 
J

jovo.miskin

Dr.Ruud said:
(e-mail address removed) schreef:


Try these:

C:> assoc .pl
C:> ftype Perl
C:> assoc .bat
C:> ftype batfile

I get these answers:

.pl=Perl
Perl="C:\Perl\bin\perl.exe" "%1" %*
.bat=batfile
batfile="%1" %*

I am getting the same output:
C:\Documents and Settings\miskinj>assoc .pl
..pl=Perl

C:\Documents and Settings\miskinj>ftype Perl
Perl="C:\Perl\bin\perl.exe" "%1" %*

C:\Documents and Settings\miskinj>assoc .bat
..bat=batfile

C:\Documents and Settings\miskinj>ftype batfile
batfile="%1" %*

C:\Documents and Settings\miskinj>

Thanks,
Jovo
 
J

jovo.miskin

The problem seem to be specific to passing arguments to system call.


Let' say we create a perl script called sys_args.pl that contanis the
next two lines:
#my $opt_exe = "ppm3-bin";
system($opt_exe, @ARGV);


And also we add at the top of ppm3-bin next two lines:
my $numargs = scalar @ARGV;
print "in ppm3_bin, numargs = $numargs\n";


The command line
sys_args.pl
produces output
in ppm3_bin, numargs = 1
The expected output is:
in ppm3_bin, numargs = 0


The command line
sys_args.pl 1 2 3
produces output
in ppm3_bin, numargs = 1
The expected output is:
in ppm3_bin, numargs = 3

Jovo
 
D

Dr.Ruud

(e-mail address removed) schreef:
Let' say we create a perl script called sys_args.pl that contanis the
next two lines:
#my $opt_exe = "ppm3-bin";
system($opt_exe, @ARGV);

That isn't much of a perl script. The first line is a comment, the
second line tries to run something undefined.

ITYM:

#/usr/bin/perl
use strict ;
use warnings ;

my $opt_exe = q/ppm3-bin/ ;

system $opt_exe, @ARGV == 0
or die qq/Error executing $opt_exe @ARGV $?/ ;
 
J

jovo.miskin

Sorry for confusion. The first line is not meant to be comment (copy
and past type of the mistake).

This is supposed to be a simple simulation to demonstrate ppm problem,
described in previous messages.

The reason that I am not able to get to ppm prompt on these machines is
that ppm.bat perform next call system($opt_exe, @ARGV); where opt_exe
is previously initialized to "ppm3-bin". So when control is transferred
to ppm3-bin, it sees one argument (on machines, that everything is
fine, it sees 0 arguments) and when it looks at $ARGV[0] it finds
garbage, and then exits.

Thanks for help,

Jovo
 
S

Sisyphus

The problem seem to be specific to passing arguments to system call.

And yet there's no problem in passing arguments from the command line to a
script via @ARGV ... right ?
That makes me think that the shell being invoked by system is a different
shell to the one you're running in. (Could the 'system' call be invoking
command.com or some other shell ?)
system($opt_exe, @ARGV);

Try forcing it to use the cmd shell by changing the system() call to:
system("cmd /C $opt_exe", @ARGV);
or
system("$ENV{COMSPEC} /C $opt_exe", @ARGV);

Do either of those invocations help ?

Cheers,
Rob
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top