[EMAIL PROTECTED] wrote: > >So, 1. from within perl.script, how can one tell if the input stream is > >coming from STDIN or a file that was opened by <>? > > Use select > > >2. If input stream is not coming from STDIN, but a file, how can one > >tell which file is the current file (assuming multiple files were > >specified on the command line)? > > My solution is the hard way. Open the files yourself and use the > respective filenames as their filehandles. > That is: > open($foo, "< $foo") or die "Could not open $foo: $!\n"; > > __________________ > > William Ampeh (x3939) > Federal Reserve Board
I'd go with your solution. The mass-file operator surely has its place, but I think it gets over-emphasized.Right offhand, I have hard time imagining a context in which I would want to do homogeous processing with a whole argument list of files. In the cases where I would want to, I can't imagine wanting to type them in at a command-line. I can't help but suspect that this gets used way too much as a symptom of operator fetishism. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>