On Sat, May 05, 2001 at 02:46:46AM +0100, Michael G Schwern wrote: > On Fri, May 04, 2001 at 04:42:07PM -0700, Nathan Wiger wrote: > > I'm wondering what this will do? > > > > $thingy = $STDIN; > > > > This seems to have two possibilities: > > > > 1. Make a copy of $STDIN > > > > 2. Read a line from $STDIN > > While perhaps inconsistent, I'd really rather it did #2. Here's the > basic argument... compare how often you dup a filehandle with how > often you read from one. Duping is swamped by several orders of > magnitude. Dup with $fh = $STDIN.copy; (or whatever). $line = > $STDIN.next should still work normally. How would you pass a handle to a subroutine, or store it inside a hash or array ? sub my_read { my $fh = shift; # whoops } I don't think it should do a dup(), but we do need to pass file handles around Graham.
- Re: Apoc2 - <STDIN> conc... David L. Nicol
- Re: Apoc2 - <STDIN> concerns Graham Barr
- Re: Apoc2 - <STDIN> concerns Damian Conway
- Re: Apoc2 - <STDIN> concerns Simon Cozens
- Re: Apoc2 - <STDIN> concerns Michael G Schwern
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns James Mastros
- Re: Apoc2 - <STDIN> concerns Michael G Schwern
- Re: Apoc2 - <STDIN> concerns David L. Nicol
- Re: Apoc2 - <STDIN> concerns James Mastros
- Apoc2 - <STDIN> concerns Graham Barr
- Apoc2 - <STDIN> concerns Nathan Wiger
- RE: Apoc2 - <STDIN> concerns Lipscomb, Al
- Re: Apoc2 - <STDIN> concerns Larry Wall
- Re: Apoc2 - <STDIN> concerns John Porter
- Re: Apoc2 - <STDIN> concerns John Porter
- Perl6 MOP (was RE: Apoc2 - <STDIN> concerns) David Whipp
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns Simon Cozens
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns Fred Heutte