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> concerns Simon Cozens
- Re: Apoc2 - <STDIN> concerns Simon Cozens
- Re: Apoc2 - <STDIN> concerns Damian Conway
- Re: Apoc2 - <STDIN> concerns Simon Cozens
- Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns Larry Wall
- Re: Apoc2 - <STDIN> concerns Stephen P. Potter
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns Michael G Schwern
- Re: Apoc2 - <STDIN> concerns James Mastros
- Re: Apoc2 - <STDIN> concerns Graham Barr
- 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 Larry Wall
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
- Re: Apoc2 - <STDIN> concerns Graham Barr
- Re: Apoc2 - <STDIN> concerns Dan Sugalski
- Re[2]: Apoc2 - <STDIN> concerns A. C. Yardley
- Re: Apoc2 - <STDIN> concerns Nathan Wiger
