develooper Front page | perl.perl5.porters | Postings from October 2014

Re: New feature proposal : <<>> to disable magic open of ARGV

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
October 3, 2014 12:11
Subject:
Re: New feature proposal : <<>> to disable magic open of ARGV
Message ID:
CAHhgV8g9t3SRKncm=mEPCc6XMTFH-iR0042k=eeMxgUpqvEQvQ@mail.gmail.com
On Fri, Oct 3, 2014 at 1:59 PM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:

> On Fri, 3 Oct 2014 13:44:32 +0200, Rafael Garcia-Suarez
> <rgs@consttype.org> wrote:
>
> > Hi, I see the failures on the reports now:
> >
> > ../t/io/argv.t .............................................. FAILED
> 29-32
> >
> > Could you run the test by hand and send the output?
>
> $ ./perl -I../lib harness -v io/argv.t
> io/argv.t ..
> 1..36
> ok 1 - <> from two files
> ok 2 - <> from a file and STDIN
> ok 3 - <> from just STDIN
> ok 4 - $ARGV is the file name
> ok 5 - $ARGV is - for explicit STDIN
> ok 6 - $ARGV is - for implicit STDIN
> ok 7 - eof() doesn't segfault
> ok 8 - $. counts <>
> ok 9 - <> from @ARGV
> ok 10
> ok 11
> ok 12
> ok 13 - eof() true on unopened filehandle
> ok 14 - STDIN has something
> ok 15
> ok 16 - eof() true with empty @ARGV
> ok 17
> ok 18
> ok 19 - eof() true after closing ARGV
> ok 20
> ok 21
> ok 22
> ok 23
> ok 24
> ok 25
> ok 26 - <<>>
> ok 27 - <<>> and rcatline
> ok 28 - <<>> from just STDIN (no argument)
> ok 29 - $ARGV is - for STDIN with <<>>
> not ok 30 - <<>> does not treat - as STDIN
> # Failed test 30 - <<>> does not treat - as STDIN at io/argv.t line 191
> #      got "Can\'t open -: A file or directory in the path name does not
> exist. at -e line 1.\n"
> # expected "Can\'t open -: No such file or directory at -e line 1.\n"
> not ok 31 - <<>> does not treat - as STDIN
> # Failed test 31 - <<>> does not treat - as STDIN at io/argv.t line 199
> #      got "Can\'t open : A file or directory in the path name does not
> exist. at -e line 1.\n"
> # expected "Can\'t open : No such file or directory at -e line 1.\n"
> not ok 32 - <<>> does not treat - as STDIN
> # Failed test 32 - <<>> does not treat - as STDIN at io/argv.t line 205
> #      got "Can\'t open : A file or directory in the path name does not
> exist. at -e line 1.\n"
> # expected "Can\'t open : No such file or directory at -e line 1.\n"
> not ok 33 - <<>> does not treat ...| as fork
> # Failed test 33 - <<>> does not treat ...| as fork at io/argv.t line 216
> #      got "Can\'t open echo foo |: A file or directory in the path name
> does not exist. at -e line 1.\n"
> # expected "Can\'t open echo foo |: No such file or directory at -e line
> 1.\n"
> # Failed test 34 - <<>> does not treat ...| as fork after eof at io/argv.t
> line 223
> #      got "Can\'t open echo foo |: A file or directory in the path name
> does not exist. at -e line 1, <> line 3.\n"
> # expected "Can\'t open echo foo |: No such file or directory at -e line
> 1, <> line 3.\n"
> not ok 34 - <<>> does not treat ...| as fork after eof
> ok 35 - ARGV aliasing and eof()
> ok 36 - deleting $::{ARGV}
> Failed 5/36 subtests
>

Of course. POSIX doesn't specify these text, but they tend to be highly
conserved among Unices. Except AIX has to be a  unique snowflake whenever
the spec allows for it…

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About