PATH Environment Variable Trouble

C

Curtis

Hello everyone:

I was debating on whether or not I should ask this in the respective
programming newsgroups, but I feel it is something I'm doing wrong on
Windows.

I have the two following paths in the System PATH environment variable:
C:\Perl\bin
C:\php5

My problem is that when I'm on the terminal, and trying to execute a
script, it doesn't seem to accept the arguments passed after the
filename. For example:

C:\>scheduler.pl a b c

Will behave as if I had not passed the a, b, or c. It's the same with
PHP.

If I alter the above to:

C:\>perl C:\dev\perl\scheduler.pl a b c

It works as expected.

I'm not sure if this is enough to go on, but I'd greatly appreciate any
assistance
 
P

Pegasus \(MVP\)

Curtis said:
Hello everyone:

I was debating on whether or not I should ask this in the respective
programming newsgroups, but I feel it is something I'm doing wrong on
Windows.

I have the two following paths in the System PATH environment variable:
C:\Perl\bin
C:\php5

My problem is that when I'm on the terminal, and trying to execute a
script, it doesn't seem to accept the arguments passed after the
filename. For example:

C:\>scheduler.pl a b c

Will behave as if I had not passed the a, b, or c. It's the same with
PHP.

If I alter the above to:

C:\>perl C:\dev\perl\scheduler.pl a b c

It works as expected.

I'm not sure if this is enough to go on, but I'd greatly appreciate any
assistance

I don't think your problem has anything to do with the %path%
environmental variable and everything with the asscociation you
have set for the .pl file extension.
 
C

Curtis

Pegasus said:
I don't think your problem has anything to do with the %path%
environmental variable and everything with the asscociation you
have set for the .pl file extension.

Thanks for the reply, Pegasus.

Just after posting, I double checked what was associated with the .PL
extension. As expected, .PL files are associated with the perl.exe
binary located in the /bin folder in my Perl installation (as specified
in documentation).

Both the file that is to be executed, and the perl.exe binary are in
directories that are specified in %PATH% as well. Yet, I still have the
problem I specified above.

It doesn't seem to be affecting standard executables. I wrote a quick
little C app to test arguments passed on the command line, and dumped
it in my batch directory (in %path%), and it works as expected, no
matter what the current working directory is.

This might well be something I've done wrong with Perl after all. If
this is the case, I'm sorry for wasting everyone's time here.

Curtis
 
M

Mark

Curtis said:
Thanks for the reply, Pegasus.

Just after posting, I double checked what was associated with the .PL
extension. As expected, .PL files are associated with the perl.exe
binary located in the /bin folder in my Perl installation (as specified
in documentation).

Both the file that is to be executed, and the perl.exe binary are in
directories that are specified in %PATH% as well. Yet, I still have the
problem I specified above.

It doesn't seem to be affecting standard executables. I wrote a quick
little C app to test arguments passed on the command line, and dumped
it in my batch directory (in %path%), and it works as expected, no
matter what the current working directory is.

This might well be something I've done wrong with Perl after all. If
this is the case, I'm sorry for wasting everyone's time here.


The problem is the %1 in the file association. I've had this happen on the
last couple machines I installed perl on.

The association has to be
"c:\Perl\bin\perl.exe" "%1" %*

The default that gets created is
"c:\Perl\bin\perl.exe" "%1"
So it passes the script name to perl.exe, but not any of the variables that
are supposed to be passed to the script.
 

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

Top