why cmd can not catch @ARGV?

Discussion in 'Perl Misc' started by lsyx, Nov 17, 2008.

  1. lsyx

    lsyx Guest

    I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
    %;.PL;
    When I use the script a.pl on cmd.exe,
    "perl a.pl xxx" can work correctly.
    "a xxx" can not catch @ARGV.
    I don't know how to config it?
    thanks very much.
    -----------CMD---------
    E:\tmp>perl a.pl xxx
    a.pl start
    xxx
    a.pl end

    E:\tmp>a.pl xxx
    a.pl start

    a.pl end

    E:\tmp>a xxx
    a.pl start

    a.pl end
    -----------CMD---------
    lsyx, Nov 17, 2008
    #1
    1. Advertising

  2. lsyx <> wrote:
    >I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
    >%;.PL;
    >When I use the script a.pl on cmd.exe,
    >"perl a.pl xxx" can work correctly.
    >"a xxx" can not catch @ARGV.
    >I don't know how to config it?


    Let me paraphrase to make sure I understand your problem correctly.

    When calling a Perl program using
    perl a.pl xxx
    then the parameter xxx is passed to the program correctly.
    However when calling like
    a.pl xxx
    or like
    a xxx
    then the parameter xxx is no passed to the program.

    The reason is a broken setting for the "Open" action for files of type
    PL. The line for "Application used to perfom action" must end with
    %*
    in order for all the parameters to be passed from cmd to perl.

    jue
    Jürgen Exner, Nov 17, 2008
    #2
    1. Advertising

  3. lsyx

    lsyx Guest

    thanks a lot.
    I fixed it In the Windows Explorer->Tools > Folder Options > File
    Types tab > PL file type > advanced ...

    On 11ÔÂ17ÈÕ, ÉÏÎç10ʱ34·Ö, J¨¹rgen Exner <> wrote:
    > lsyx <> wrote:
    > >I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
    > >%;.PL;
    > >When I use the script a.pl on cmd.exe,
    > >"perl a.pl xxx" can work correctly.
    > >"a xxx" can not catch @ARGV.
    > >I don't know how to config it?

    >
    > Let me paraphrase to make sure I understand your problem correctly.
    >
    > When calling a Perl program using
    > perl a.pl xxx
    > then the parameter xxx is passed to the program correctly.
    > However when calling like
    > a.pl xxx
    > or like
    > a xxx
    > then the parameter xxx is no passed to the program.
    >
    > The reason is a broken setting for the "Open" action for files of type
    > PL. The line for "Application used to perfom action" must end with
    > %*
    > in order for all the parameters to be passed from cmd to perl.
    >
    > jue
    lsyx, Nov 17, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Black
    Replies:
    8
    Views:
    4,150
    Xenos
    Aug 20, 2004
  2. Achim Domma (Procoders)

    read input for cmd.Cmd from file

    Achim Domma (Procoders), Jun 3, 2005, in forum: Python
    Replies:
    2
    Views:
    8,057
    Peter Otten
    Jun 3, 2005
  3. Sarir Khamsi

    Interpreter-like help in cmd.Cmd

    Sarir Khamsi, Jun 9, 2005, in forum: Python
    Replies:
    4
    Views:
    362
    Bengt Richter
    Jun 26, 2005
  4. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    [exec cmd for cmd in cmds]

    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Mar 8, 2006, in forum: Python
    Replies:
    3
    Views:
    382
    Scott David Daniels
    Mar 8, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,804
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page