Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Help with processing command line arguments

by diotalevi (Canon)
on Dec 15, 2002 at 18:52 UTC ( [id://220037]=note: print w/replies, xml ) Need Help??


in reply to Help with processing command line arguments

It sounds like you are using something DOS, Windows 95, Windows 98 or Windows ME. You can't run scripts just by typing their name - you have to pass the script file name into perl first. This looks something like C:\SRC> perl myscript.pl add 1 2. I think you're typing something like C:\SRC> myscript.pl add 1 2 instead. Or at least that's what I get from your error message.

Replies are listed 'Best First'.
Re: Re: Help with processing command line arguments
by mt2k (Hermit) on Dec 15, 2002 at 23:55 UTC
    Depends. If you've got a file association set up with perl scripts (or more correctly put, an extension, such as '.pl'), then a call to perl is not necessary. But in his case, I believe you are correct in a way: I don't think he has a file association set up for the extension he uses for his scripts.

    -------------------------------------
    eval reverse@{[lreP
    =>q{ tsuJ\{qq},' rehtonA'
    ,q{\}rekcaH },' tnirp']}[1+1+
    1,1-1,1+1,1*1,(1+1)*(1+1)];
    -------------------------------------
    

      Oh but it is, it is! The problem is that the DOS/Windows versions I've listed don't have a command shell powerful enough associate file extensions with an interpreter. Remember - you're restricted to command.com here.


      Fun Fun Fun in the Fluffy Chair

        You can use start to get file-associations from the command line, as in start file.pl 1 2 3. (However, this will launch perl in a sperate process and window.)


        Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://220037]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found