Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 ( #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
Node Status?
node history
Node Type: note [id://22099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2020-06-02 03:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (12 votes). Check out past polls.

    Notices?