in reply to How to write a program to read stdin or command line?
I'd use Getopt::Long (or Getopt::Std, if that's your preference) to tell the program whether the input is on the commandline or not. One convention for this is to expect the input data on the commandline by default, but if a -i (--input) option is present, to read stdin instead.
A word spoken in Mind will reach its own level, in the objective world, by its own weight
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to write a program to read stdin or command line?
by ikegami (Patriarch) on Oct 02, 2007 at 15:27 UTC | |
by jdporter (Paladin) on Oct 02, 2007 at 17:50 UTC | |
Re^2: How to write a program to read stdin or command line?
by naikonta (Curate) on Oct 03, 2007 at 07:13 UTC |
In Section
Seekers of Perl Wisdom