On Sat Dec 31 05:44:58 2011, jkeenan wrote:
> On Mon Mar 11 04:16:33 2002, tagunov@motor.ru wrote:
> > This is a bug report for perl from "Anton Tagunov" <tagunov@motor.ru>
> > generated with the help of perlbug 1.33 running under perl v5.7.3.
> >
> >
> > -----------------------------------------------------------------
> > Hello, developers!
> >
> > I have discovered some peculiarities with '-' argument to open,
> > and sthoenna@efn.org (Yitzchak Scott-Thoennes) (bs"d) has confirmed
> > that:
> >
> > YST>...open V, '-' seems to be equivalent to
> > YST>*V = *STDIN{IO}; close V then seems to do absolutely
> > YST>nothing. close STDIN, on the other hand, closes the
> > YST>in-file-pointer shared by V and STDIN.
> >
>
> Reviewing this older ticket, I noticed that there was no code example
> provided. I wrote the following, but it does not seem to support the
> original poster's contention that "close V then seems to do absolutely
> nothing." (Using Perl 5.14.2 on Darwin/PPC.)
>
> #####
> $ cat 8826.pl
> #!/usr/local/bin/perl
> use strict;
> use warnings;
>
> open V, '-';
> for (my $i=0; $i<=2; $i++) {
> my $line = <V>;
> print $line;
> }
> close V;
>
> my $next_line = <V>;
> print $next_line;
>
> $ cat lines
> alpha
> beta
> gamma
> delta
>
> $ cat lines | perl ./8826.pl
> alpha
> beta
> gamma
> readline() on closed filehandle V at ./8826.pl line 12.
> Use of uninitialized value $next_line in print at ./8826.pl line 13.
> #####
>
> If the filehandle has indeed been closed, then there's no need for the
> documentation patch the poster suggested. Thoughts?
>
> Thank you very much.
> Jim Keenan
No response in nearly four months. I propose we close this ticket.
Thank you very much.
Jim Keenan
---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=8826
Thread Previous
|
Thread Next