473,624 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing argument not working...

Hi there,

I just installed Perl (v. 5.6.1. built for MSWin32 from ActiveState)
on a new server Windows 2000.
Amazingly the passing of arguments doesn't work !

I saved the following code in a file saved in "test.pl" :

#!/bin/perl -s

print STDOUT "NbArgument s: $#ARGV\n";
print STDOUT "$ARGV[0], $ARGV[1]\n";

When I call it by "test.pl arg1 arg2", I get:
NbArguments : -1
,

I ran the same code on 2 other machines (XP and W2000): it works
normally...
I also installed another Perl version (INDIGOPERL) on this Server
W2000... and I keep getting the same weird behaviour !
Any idea ??? Does it have to do with the configuration or with
registry entries ?

Thanks for your contribution !

R.Favre
Jul 19 '05 #1
1 5793
The problem has been solved in the meantime...

Surprisingly on this W2000 machine, I need to launch a perl script in
beginning with the command "perl" in order to have the arguments
recognized and passed further:
"perl test.pl arg1 arg2" and not just "test.pl arg1 arg2"
On the other W2000 machine that I have, it isn't necessary to begin
with the "perl" command... Strange, but it works that way!
Have a great day
ro***********@h otmail.com (Romuald Favre) wrote in message news:<34******* *************** ****@posting.go ogle.com>...
Hi there,

I just installed Perl (v. 5.6.1. built for MSWin32 from ActiveState)
on a new server Windows 2000.
Amazingly the passing of arguments doesn't work !

I saved the following code in a file saved in "test.pl" :

#!/bin/perl -s

print STDOUT "NbArgument s: $#ARGV\n";
print STDOUT "$ARGV[0], $ARGV[1]\n";

When I call it by "test.pl arg1 arg2", I get:
NbArguments : -1
,

I ran the same code on 2 other machines (XP and W2000): it works
normally...
I also installed another Perl version (INDIGOPERL) on this Server
W2000... and I keep getting the same weird behaviour !
Any idea ??? Does it have to do with the configuration or with
registry entries ?

Thanks for your contribution !

R.Favre

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3955
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer http://sourceforge.net/projects/cpp-perfometer http://alexvn.freeservers.com/s1/perfometer.html
15
4665
by: Dave | last post by:
I'm currently working on a small project (admitedly for my CS class) that compares the time difference between passing by value and passing by reference. I'm passing an array of 50000 int's. However, since in C++ an array is passed by reference by default I need to embed the array into a struct in order to pass it by value. The problem is that I get a segmentation error when doing so. I'm using the Dev-c++ compiler. Any ideas? ...
3
14927
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
6
3522
by: Adrian | last post by:
I am trying to pass the address of a C++ function into a Fortran routine to enable the Fortran routine to call this C++ function. I have to do it this way as our build process does not allow circular dependencies of DLL's. Does anyone know how to do this, I have tried everything in my book. I have a C++ function GetP: DllExport void GetP()
25
2922
by: Victor Bazarov | last post by:
In the project I'm maintaining I've seen two distinct techniques used for returning an object from a function. One is AType function(AType const& arg) { AType retval(arg); // or default construction and then.. // some other processing and/or changing 'retval' return retval; }
17
3588
by: Charles Sullivan | last post by:
The library function 'qsort' is declared thus: void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); If in my code I write: int cmp_fcn(...); int (*fcmp)() = &cmp_fcn; qsort(..., fcmp); then everything works. But if instead I code qsort as:
17
9372
by: LP | last post by:
Hello, Here's the scenario: Object A opens a Sql Db connection to execute number of SqlCommands. Then it needs to pass this connection to a constructor of object B which in turn executes more commands on the same connection. I have an understanding that if SqlConnection is passed as "value" (unboxed), object B will create its own copy of SqlConnection, so when object A closes its connection, it remains open for object B's copy. Is this
6
5577
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an object collection and stanrd using it it starts to fall apart. Clearly there is something about javascript's usage of passing "By ref" that i am not getting. i have had a look on the web and found some examples, but i cant see why my code does not...
1
1962
by: User1014 | last post by:
Since you can pass a function to a ... erm...... function.... how to you use the result of a function as the argument for another function instead of passing the actual function to it. i.e. function foo2(){} function foo(func){}
12
2579
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned by value temporaries are created?(I'm not touching yet the cases where standard allows optimizations from the side of implementations to avoid copying) If so, please quote part of the standard that says that. Assuming it is true, I can imagine two...
0
8240
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.