Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #112988] excessive errors when foo.pl does not exist

3 views
Skip to first unread message

Siddhant Saraf

unread,
May 18, 2012, 4:24:36 PM5/18/12
to bugs-bi...@rt.perl.org
# New Ticket Created by Siddhant Saraf
# Please include the string: [perl #112988]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=112988 >


$ perl6 foo
Error while reading from file: Unable to open filehandle from path 'foo.pl'
current instr.: 'nqp;HLL;Compiler;_block1994' pc 35586
(src/stage2/gen/NQPHLL.pir:13627) (src/stage2/gen/NQPHLL.pm:1453)
called from Sub 'nqp;HLL;Compiler;evalfiles' pc 35251
(src/stage2/gen/NQPHLL.pir:13472) (src/stage2/gen/NQPHLL.pm:1439)
called from Sub 'nqp;HLL;Compiler;_block1868' pc 34069
(src/stage2/gen/NQPHLL.pir:12887) (src/stage2/gen/NQPHLL.pm:1387)
called from Sub 'nqp;HLL;Compiler;command_eval' pc 33637
(src/stage2/gen/NQPHLL.pir:12701) (src/stage2/gen/NQPHLL.pm:1402)
called from Sub 'nqp;Perl6;Compiler;command_eval' pc 1205
(src/gen/perl6-compiler.pir:485) (src/Perl6/Compiler.nqp:18)
called from Sub 'nqp;HLL;Compiler;command_line' pc 33259
(src/stage2/gen/NQPHLL.pir:12525) (src/stage2/gen/NQPHLL.pm:1353)
called from Sub 'MAIN' pc 1029 (src/gen/perl6.pir:392) (src/main.nqp
src/gen/main-version.nqp:35)
called from Sub '_block1000' pc 105 (src/gen/perl6.pir:73)
(src/main.nqp src/gen/main-version.nqp:1)

now, that's too much information. Ideally it should be something like
what perl(5) says :

$ perl foo.pl
Can't open perl script "foo.pl": No such file or directory

It clearly says "no such file".

Christian Bartolomaeus via RT

unread,
Oct 7, 2014, 4:11:24 PM10/7/14
to perl6-c...@perl.org
This looks better now:

$ perl6-m foo
Could not open foo. Failed to open file: no such file or directory
$ perl6-p foo
Could not open foo. Unable to open filehandle from path 'foo': No such file or directory(2)
$ perl6-j foo
Could not open foo. java.nio.file.NoSuchFileException: foo

So, I'd say closable with tests. (Though I don't know how a good test would look like.)

Will Coleda via RT

unread,
Oct 9, 2014, 5:13:54 PM10/9/14
to perl6-c...@perl.org
use the is_run helper function from Test::Util - you can exec out to the same perl6 that was used to run the tests with an unlikely to be found filename.pl, then check the output in STDERR. (that it contains "Could not open <file>")

--
Will "Coke" Coleda

Christian Bartolomaeus via RT

unread,
Oct 10, 2014, 7:30:02 AM10/10/14
to perl6-c...@perl.org
I added a test (using is_run) to S19-command-line/arguments.t with the following commit:
https://github.com/perl6/roast/commit/3cee096456

S19-command-line/arguments.t is a new file in roast and as such not yet included in t/spectest.data in Rakudo. I'll leave the ticket open until that is done.
0 new messages