[Python-Dev] RE: fileinput.py

Thomas Wouters thomas@xs4all.net
Fri, 5 Jan 2001 22:19:42 +0100


On Fri, Jan 05, 2001 at 03:46:10PM -0500, Tim Peters wrote:

> "<>" (wihtout a filehandle) seems
> rarely used in Perl practice, though, *except* in support of
> 
> your_shell_prompt> some_perl_script < some_file
> 
> That is, "<>" is usually used simply as an abbrevision for <STDIN>, and I
> bet *most* Perl programmers don't even know "<>" is more general than that.

Well, I can't say anything about *most* Perl programmers, but all Perl
programmers I know (including me) know damned well what <> does, and use it
frequently. And in all the ways: no arguments meaning <STDIN>, a list of
files meaning open those files one at a time, using - to include stdin in
that list, accessing the filename and linenumber, etc. None of them can be
called newbies, though.

But then, I like using Python's fileinput, too, so maybe I'm just weird :)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!