passing argument not working...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Romuald Favre

    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
  • Romuald Favre

    #2
    Re: passing argument not working...

    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


    romuald_favre@h otmail.com (Romuald Favre) wrote in message news:<34623cba. 0308131158.64e7 a3d3@posting.go ogle.com>...[color=blue]
    > 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[/color]

    Comment

    Working...