NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Far too complicated (Score:1)
The key is that the question files must be given as commandline arguments, not passed in via redirection. The
<>diamond operator will read from the files listed in@ARGVand you can read STDIN separately from it at the same time.Re: (Score:1)
foo.pl inputfile.txt
But what if you want to do
grep bar inputfile.txt | foo.pl
instead?
Ordinary morality is for ordinary people. -- Aleister Crowley
Re: (Score:1)
If you use bash, you can use process substitution instead:
foo.pl <( grep bar inputfile.txt )Re: (Score:1)
Ordinary morality is for ordinary people. -- Aleister Crowley
Re:Far too complicated (Score:1)
It’s more reliable (
/dev/ttyisn’t always available) and more flexible (you don’t need Expect to feed it answers from a file, you just redirect standard input). But the clincher for me is that it’s still less and simpler code. Cf. Carter’s Compass.Reply to This
Parent
Re: (Score:1)
Ordinary morality is for ordinary people. -- Aleister Crowley