bh_perl has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Getopt::Std; my $prog = $0; $prog =~ s|.*/||; my %opts; getopts('o:', \%opts); my $cmd = $opts{o} || 1; my %wordDb = (); unshift (@ARGV, "-") unless @ARGV; for my $file (@ARGV) { open (IN, "< $file") or warn ("Can't open $file: $!\n"), die; my $data = $_; print ("$file ==> $data\n"); close(IN); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can't print data from the input file in Command Line processing.
by Roger (Parson) on Dec 01, 2003 at 06:41 UTC | |
Re: Can't print data from the input file in Command Line processing.
by bbfu (Curate) on Dec 01, 2003 at 06:53 UTC | |
by Anonymous Monk on Dec 01, 2003 at 07:53 UTC |