473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

@ARGV not working with Windows Server 2003 service pack 2

I cannot access command line variables, e.g. $ARGV[0], using perl on a Windows 2003 server with service pack 2.
Does anyone know of a bug or a work around?
Here's my test....
when I enter "test.pl hi", I get "no arguments".

Expand|Select|Wrap|Line Numbers
  1. #!c:\perl\bin\perl.exe
  2. #test.pl
  3. if (defined($ARGV[0])) {
  4.     print "input parm=$ARGV[0]\n";
  5. } else {
  6.     print "no arguments\n";
  7. }
  8. exit;
  9.  
Jul 26 '07 #1
4 2172
I discovered that if I run the program prefaced with "perl", it works.
So it 'half' works without the "perl" preface (i.e. the second print statement works, so perl is running in some fashion), and it works completely if I use "perl" before the program name. I am guessing it is some sort of operating system defect. Any thoughts? (at least I have a work around)
Jul 26 '07 #2
numberwhun
3,509 Expert Mod 2GB
As a general rule, on Windows, you should always issue your programs as:

c:\> perl script.pl [options]

Just stick to that and things will work better. If you really want to use the shebang and not have to use the above format, then switch to a *nix operating system such as Linux or Solaris.

Regards,

Jeff
Jul 26 '07 #3
I discovered that the path environment variable had c:\perl\site\bin and c:\perl\bin. When I removed the c:\perl\site\bin entry, the problem was fixed.
Jul 26 '07 #4
numberwhun
3,509 Expert Mod 2GB
Good to hear and thank you for the follow up!

Regards,

Jeff
Jul 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Simon Chester | last post by:
Hello! Can anyone help me with this problem?... I have developed an ASP.NET (version 1.1) application which I have deployed to a number of webservers. The web application works fine on Windows...
4
by: Matthew Louden | last post by:
My ASP.NET application is working fine when I run under IIS Personal Web Server in Windows 2000 machine. However, after I upload all the files to the Windows Server 2003 machine, and tried to run...
10
by: Ger | last post by:
I am having problems using VB.Net's Management base object on a machine hosting Windows Server 2003. I am trying to set file permissions from a Windows Service. These files may be loacted on a...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
0
by: KeithZ | last post by:
I have created a very simple vb.net web service. It works fine on my local machine and every other machine I have installed it on. For the life of me I cannot get it to work on my production...
1
by: Serge Skorokhodov (216716244) | last post by:
Hi, Service pack for VC++.NET 2003 was promised in March. Any news? TIA -- Serge
10
by: deathtospam | last post by:
My employer is starting to take the first steps towards migrating its Classic ASP codebase to ASP.NET v2.0. We have a copy of our existing website on the new Windows Server 2003 R2 test server,...
5
by: Chris Gage | last post by:
I'm a longtime *nix guy and am fairly comfortable "over there" although I am a developer and not a sysadmin, mostly J2EE stuff. I recently got the Microsoft "Action Pack" as a partner. It has...
0
by: =?Utf-8?B?cGx1cG9z?= | last post by:
Hi, Problem issue 925522, http://support.microsoft.com/kb/925522/en-us (“An FTP session that is copying a file from an FTP server appears to stop responding on a client computer that is running...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.