Command line options Input >Output how? 
Author Message
 Command line options Input >Output how?

How can I modify my script to reference a DOS command line option
for infile and outfile.

I run Perl from the DOS command line and I would like to pass the
input filename and the output filname when I run the program.

C:\>perl script.pl input output

I only know how to include the name in the actual script.  Which I have
to edit every time I need a new file to try.

# SCRIPT.PL

$input = "file.in";
$output = "file.out";

open (FILE, $input);
open (OUTPUT, ">$output");

while (<FILE>) {

## put routines here ;

print (OUTPUT);

Quote:
}

close (FILE);
close (OUTPUT);

____________________________________________________

Rick Trankle      *            DataViews            

312.777.9290      *    Certified Infobase Engineer  
FAX 777.9293             Folio VIEWS Consultant      
                  *                                  
____________________________________________________



Mon, 03 Nov 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. capturing command line error or output from `<command>`

2. Output of a command line command

3. Problem checking if a command line option has been specified using Getopt::Long

4. ANNOUNCE: Getopt::Long 2.9 -- Universal command line options processing

5. multiopt.pl - reads command line options

6. -S command line option

7. Custom Makefile.PL command line options and recursive behavior

8. ANNOUNCE: Getopt::Long 2.6 -- Universal command line options processing

9. Trouble running Satan under Linux with command line options

10. Multiple copies of the same option on command line

11. perl command line options

12. Command line options

 

 
Powered by phpBB® Forum Software