CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=43200
server: Combust/Plack (Perl)
vary: Accept-Encoding
content-encoding: gzip
content-length: 2278
content-type: text/html; charset=utf-8
last-modified: Sat, 11 Oct 2025 15:50:02 GMT
traceparent: 540e3e9d54f5b9447e9cb32f2aeef5ae
strict-transport-security: max-age=15768000
RE: Changing magic <> without changing core - nntp.perl.org
Front page | perl.perl5.porters |
Postings from July 2008
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About

RE: Changing magic <> without changing core
Thread Previous | Thread NextFrom:
Ed AvisDate:
July 28, 2008 06:56Subject:
RE: Changing magic <> without changing coreMessage ID:
7A5C308A1A3D554B8B8C0E331F7D2BB10ECCA9@wcl-exc.wcl.local>readline override vs tieing a specific magic filehandle ? I couldn't really say; a tied filehandle to me seems more normal and overriding readline more exotic and Acme-like. But that could be because I've never done it. There is one wrinkle: from perlvar(1): ARGV The special filehandle that iterates over command-line filenames in @ARGV. Usually written as the null filehandle in the angle operator "<>". Note that currently "ARGV" only has its magical effect within the "<>" operator; elsewhere it is just a plain filehandle corresponding to the last file opened by "<>". In particular, passing "\*ARGV" as a parameter to a function that expects a filehandle may not cause your function to automatically read the contents of all the files in @ARGV. I guess this is a symptom of it being implemented by overriding readline. A tied filehandle would not have this caveat. So readline would have better backwards compatibility. I see no reason not to use a tied filehandle and get rid of this caveat, making both ARGV and MAGIC_ARGV work everywhere not just in <>. But I don't want to fight a holy war on two fronts against two different crusty misfeatures :-p. So whichever is easiest. The $ARGV magic variable name currently works with <>. I think it would be overkill to set up a separate magic variable just for <<>> or whatever. You only use one or the other way of reading from files on the command line, never both in the same program. So $ARGV can work with both. -- Ed Avis <eda@waniasset.com> ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit https://www.messagelabs.com/email ______________________________________________________________________Thread Previous | Thread Next
- Changing magic <> without changing core by Aaron Crane
- Re: Changing magic <> without changing core by Ed Avis
- Re: Changing magic <> without changing core by Bram
- Re: Changing magic <> without changing core by Aristotle Pagaltzis
- Re: Changing magic <> without changing core by Bram
- Re: Changing magic <> without changing core by Rafael Garcia-Suarez
- Re: Changing magic <> without changing core by Aristotle Pagaltzis
- Re: Changing magic <> without changing core by Mark Mielke
- Re: Changing magic <> without changing core by Johan Vromans
- Re: Changing magic <> without changing core by Glenn Linderman
- Re: Changing magic <> without changing core by Ed Avis
- Re: Changing magic <> without changing core by Mark Mielke
- Re: Changing magic <> without changing core by Ed Avis
- Re: Changing magic <> without changing core by Rafael Garcia-Suarez
- magic <<>> (was: Re: Changing magic <> without changing core) by Bram
- Re: magic <<>> (was: Re: Changing magic <> without changing core) by Rafael Garcia-Suarez
- Re: Changing magic <> without changing core by Ed Avis
- Re: Changing magic <> without changing core by Rafael Garcia-Suarez
- RE: Changing magic <> without changing core by Ed Avis
- Re: Changing magic <> without changing core by Rafael Garcia-Suarez
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About