Skip Menu |
 

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 58527
Status: open
Priority: 0/
Queue: Devel-REPL

People
Owner: Nobody in particular
Requestors: chm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.003011
Fixed in: (no value)



Subject: would like better errors from 'do filename' construct
Download (untitled) / with headers
text/plain 1.1k
The Devel::REPL shell is nice in that it manages to be a more complete and correct perl interpreter. However, in some cases, it would be nice to have better diagnostics when running interactively. Specifically, the 'do filename' construct gives no errors when filename fails to compile. You can process the return value yourself, but it would be nicer if the problem was indicated immediately in the shell. Here is an example session with do where the file tries to use a non-existent module named Bogus. I would like to see the compile error message rather than just a quiet failure and looking for the false return value to figure out something went wrong. bash$ cat bogus use Bogus; 1; $ perl -c bogus Can't locate Bogus.pm in @INC (@INC contains: /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at bogus line 1. BEGIN failed--compilation aborted at bogus line 1. bash$ re.pl $ do 'bogus' $
Download (untitled) / with headers
text/plain 1.4k
After further work on the PDL shell, I realize that this is more than just a nice-to-have feature bug should be considered a bug in the error reporting from the Devel::REPL shell. As an example, based on the following test file: bash$ cat bogus use Bogus; 1; now I run the Devel::REPL shell and try do-ing the file: bash$ re.pl $ do 'bogus' $ while if I use the original perldl shell from the PDL-2.4.6 or earlier release, I get bash$ perldl # skipping startup messages Show quoted text
pdl> do 'bogus'
Loading flhist.pdl ...found /cygdrive/e/chm/CASP/pdl/general/flhist.pdl Can't locate Bogus.pm in @INC (@INC contains: /cygdrive/e/perl/pdl_lib/i686-cygwin-thread-multi-64int /cygdrive/e/perl/pdl_lib /cygdrive/e/perl/usr_lib/i686-cygwin-thread-multi-64int /cygdrive/e/perl/usr_lib /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at bogus line 1, <AUTOLOAD_FILE> line 17. BEGIN failed--compilation aborted at bogus line 1, <AUTOLOAD_FILE> line 17. Show quoted text
pdl>
where you can see the expected error messages with the line numbers and diagnostics for the failure. I'm not sure the best way to fix the problem but if I sort it out before another Devel::REPL developer does, I'll be sure to push the fix upstream.
NOTE: Technically, the do filename construct is being handled correctly by the shell. It is more of a nice-to-have that the REPL give better diagnostics for the operation rather than the user being forced to implement full checking every time. It would be more useful if the $! error were given if there were a file access problem and $@ would be great if there were a compile problem. Maybe these errors could be done transparently to the code execution... On Fri Aug 06 09:20:22 2010, CHM wrote: Show quoted text
> > After further work on the PDL shell, I realize that > this is more than just a nice-to-have feature bug > should be considered a bug in the error reporting > from the Devel::REPL shell. > > As an example, based on the following test file: > > bash$ cat bogus > use Bogus; > 1; > > now I run the Devel::REPL shell and try do-ing the file: > > bash$ re.pl > $ do 'bogus' > > $ > > while if I use the original perldl shell from the > PDL-2.4.6 or earlier release, I get > > bash$ perldl > # skipping startup messages
> pdl> do 'bogus'
> Loading flhist.pdl ...found /cygdrive/e/chm/CASP/pdl/general/flhist.pdl > Can't locate Bogus.pm in @INC (@INC contains: > /cygdrive/e/perl/pdl_lib/i686-cygwin-thread-multi-64int > /cygdrive/e/perl/pdl_lib > /cygdrive/e/perl/usr_lib/i686-cygwin-thread-multi-64int > /cygdrive/e/perl/usr_lib /usr/lib/perl5/5.10/i686-cygwin > /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin > /usr/lib/perl5/site_perl/5.10 > /usr/lib/perl5/vendor_perl/5.10/i686-cygwin > /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 > /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at bogus > line 1, <AUTOLOAD_FILE> line 17. > BEGIN failed--compilation aborted at bogus line 1, <AUTOLOAD_FILE> > line 17. >
> pdl>
> > where you can see the expected error messages with the > line numbers and diagnostics for the failure. I'm not > sure the best way to fix the problem but if I sort it > out before another Devel::REPL developer does, I'll > be sure to push the fix upstream.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.