in reply to unix to windows?

if you associate .pl files with perl... you can do that from the command prompt in win2k...

Replies are listed 'Best First'.
Re: Re: unix to windows?
by TGI (Parson) on Jun 03, 2001 at 02:00 UTC

    I don't know about NT5, but in NT4 associating .pl files to perl does not get the arg list passed to perl. I think there is some syntax you can use when you set up the association.

    In DOS, IIRC, the numbered variables $1 $2 and so on are the command line args. Note that $0 is the name of the command.

    The batch wrappers use this to work. They generally call perl and have it read in and execute $0 with $1 etc as args. Look inside them for help, there may be a general arg list DOS variable, but I don't know what it is..

    You may just want to buy/get a unix shell for windows. I use MKS toolkit at work. The main thing I like about it (I almost never use its shell) is that I get many of the unix command I know and love while I am in dos-hell. Just the addition of a decent more is a wonderful thing...

    UPDATE: PiEquals3 is quite right about the variables. Use %1, etc. for batch files. I just discovered that %* is all the args. Which language am I using?

    REM foo.bat echo %* REM End of foo.bat c:\foo bar baz bar baz

    So, I just tried switching my .pl association to 'c:\perl\bin\perl.exe %0 %*'. It seems fine so far.


    TGI says moo

      Hey thanks for the info!! MKS is EXACTLY what I was looking for! Now I all I have to do is check with managment! So far it seems the only aspect I need is the korn shell feature
        damn management DX'ed it!
      "In DOS, IIRC, the numbered variables $1 $2 and so on are the command line args. Note that $0 is the name of the command."

      <NITPICK>
      Eh.. The prefix is '%'. i.e.: %0 %1 %2 etc.
      </NITPICK>

      ...at least in a batch file, which is what we're talking about, right?


      --
      PiEquals3
      "Et tu, obfuscation?"