Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: how can I input different files as an argument while I am running my perl program?

by plaid (Chaplain)
on Jul 12, 2000 at 00:27 UTC ( [id://22099]=note: print w/replies, xml ) Need Help??


in reply to how can I input different files as an argument while I am running my perl program?

When you run your program, just specify the filename as an argument on the command line:
./program.pl file1.txt <optionally more files>
The filenames can then be found inside the script in the global array @ARGV.
  • Comment on Re: how can I input different files as an argument while I am running my perl program?
  • Download Code

Replies are listed 'Best First'.
RE: Re: how can I input different files as an argument while I am running my perl program?
by Anonymous Monk on Jul 12, 2000 at 01:01 UTC
    Thanks very much for the reply. However, does that mean that in my perl program, I should include the following line: open (INFILE, @ARGV); in order for me to input different textfiles when I type in the command line? btw is it necessary for me to include -x when I specify the path?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found