It's annoyed me for a while that do_print was only in pdl2, not in perldl. I've just added it to perldl, with the bonus feature that if you have ; as the last character in your expression, it still won't print (like MATLAB, sort of).
Please give it a go (on master) and report any problems! Best regards, Ed ________________________________ From: Jörg Sommrey <j...@sommrey.de> Sent: 22 January 2025 15:33 To: Ed . <ej...@hotmail.com> Cc: Luis Mochan <moc...@icf.unam.mx>; perldl <pdl-devel@lists.sourceforge.net>; perldl <pdl-gene...@lists.sourceforge.net> Subject: Re: [Pdl-devel] pdl scripts On Wed 22 Jan 2025 03:55:20 PM CET, "Ed ." <ej...@hotmail.com> wrote: > Hi Jörg, > > Can you please spell out what happens when you run "pdl" (which is > the compiled C executable that runs perldl)? It's supposed to work. Yes it actually does work - my fault. It was 'do_print 1;' in .perldlrc that caused 'pdl' to fail. I should have read the error message explaining the error. The 'perl>' prompt just rang a bell. It's a bit strange: I have been using 'do_print' for a long time now and I was not aware it was available in 'pdl2' only. -jo > > pdl2 won't work "out of the box", since it got removed due to its > very heavy dependencies. To run that now, you'll need to do cpanm > PDL::Perldl2 (and then wait for Moose et al to get installed). > > Best regards, > Ed > > ________________________________ > From: Jörg Sommrey <j...@sommrey.de> > Sent: 22 January 2025 14:30 > To: Luis Mochan <moc...@icf.unam.mx> > Cc: Ed . <ej...@hotmail.com>; perldl > <pdl-devel@lists.sourceforge.net>; perldl > <pdl-gene...@lists.sourceforge.net> > Subject: Re: [Pdl-devel] pdl scripts > > Hi Luis, > > you might try 'pdl2' instead of 'pdl'. The latter doesn't work for me > neither after upgrading PDL lately. > Just a guess. > > -jo > > On Wed 22 Jan 2025 04:46:09 AM CET, Luis Mochan <moc...@icf.unam.mx> wrote: > >> Hi Ed, >> >> Maybe I didn't explain the issue, maybe I don't quite understand >> it. And maybe I didn't quite understand your answer: >> >> 1. I made a new account in my laptop >> 2. I installed perlbrew >> 3. I installed perl-5.40.1 >> 4. In installed cpanm >> 5. I installed PDL with cpanm >> 6. I ran pdl >> 7. I obtained the answer: >> >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> * WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in >> @INC (you may need to install the Term::ReadKey module) (@INC >> entries checked: >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> Compilation failed in require at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> Compilation failed in require at (eval 13) line 1. >> ' - trying blib. >> WARNING: PDL startup not found only plain perl available >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> ** perl> >> >> The line marked with an * above says: 'WARNING: Error loading PDL: >> 'Can't locate Term/ReadKey.pm in @INC (you may need to install the >> Term::ReadKey module)...' >> >> So it is not that I (or my students) care about Term::ReadKey, it is >> that the advice we got is that we'd better install it. >> >> Also, the line marked with ** shows we obtained the prompt 'perl>' >> instead of the expected prompt 'pdl>'. >> >> In my previous installations, I hadn't had this problem, as I >> installed manually many required and optional pre-requisites, >> including Term::ReadLine::Gnu, which I guess is the readline you >> mention in your answer. However, installing Term::Readline::Gnu didn't >> help with the problem above. I obtained again: >> >> $ pdl >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> WARNING: Error loading PDL: 'Can't locate Term/ReadKey.pm in >> @INC (you may need to install the Term::ReadKey module) (@INC >> entries checked: >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1 >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1/x86_64-linux >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/5.40.1) at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/Doc/Perldl.pm >> line >> 52. >> Compilation failed in require at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> BEGIN failed--compilation aborted at >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/default.perldlrc >> line >> 37. >> Compilation failed in require at (eval 11) line 1. >> ' - trying blib. >> WARNING: PDL startup not found only plain perl available >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> >> perl> >> >> But after installing ReadKey things started behaving as usual: >> >> $ cpanm Term::ReadKey >> --> Working on Term::ReadKey >> Fetching >> http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz >> ... OK >> Configuring TermReadKey-2.38 ... OK >> Building and testing TermReadKey-2.38 ... OK >> Successfully installed TermReadKey-2.38 >> 1 distribution installed >> $ pdl >> perlDL shell v1.357 >> PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file >> 'COPYING' in the PDL distribution. This is free software and you >> are welcome to redistribute it under certain conditions, see >> the same file for details. >> ReadLines, NiceSlice, MultiLines enabled >> Reading PDL/default.perldlrc... >> Found docs database >> /home/mochan2/perl5/perlbrew/perls/perl-5.40.1/lib/site_perl/5.40.1/x86_64-linux/PDL/pdldoc.db >> Type 'help' for online help >> Type 'demo' for online demos >> Loaded PDL v2.098 (supports bad values) >> >> Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended) >> >> pdl> >> >> So, what is the user expected to do? The installation of PDL was declared >> succesful, a program ('pdl') distributed with PDL was installed, the >> program didn't run smoothly and sent error messages asking the user to >> install another package: Term::ReadKey. How would you interpret this >> situation as a new user? Wouldn't you be confused? Wouldn't you >> conclude there is something wrong? >> >> I don't know what is the correct solution. I suggested adding >> Term::ReadKey to the required packages, so it would be installed >> automatically. Maybe that is not the correct solution, but then, I >> don't know, what would be the correct solution? >> >> Best regards, >> Luis >> >> >> >> >> On Tue, Jan 21, 2025 at 10:40:32PM +0000, Ed . wrote: >>> Hi Luis, >>> >>> PDL isn't just an interactive environment. "Required" would be >>> wrong. I use the interactive part very heavily (which isn't very >>> surprising), and wouldn't want to use it without readline (which I >>> have faced when debugging in a qemu environment on a weird >>> architecture). I am not going to make any of the Term::* be >>> "required" for PDL. I hope you understand. >>> >>> If it helps, the REPL script was installed, but not all of the >>> components. It does sound like you're asking me to make a separate >>> PDL::REPL repo where that stuff would live, but I don't want to do >>> that. >>> >>> Best regards, >>> Ed >>> >>> ________________________________ >>> From: Luis Mochan <moc...@icf.unam.mx> >>> Sent: 21 January 2025 20:07 >>> To: Ed . <ej...@hotmail.com> >>> Cc: perldl <pdl-gene...@lists.sourceforge.net>; perldl >>> <pdl-devel@lists.sourceforge.net> >>> Subject: Re: [Pdl-devel] pdl scripts >>> >>> Hi Ed, >>> >>> On Tue, Jan 21, 2025 at 05:13:09PM +0000, Ed . wrote: >>> > Hi Luis, >>> > >>> > That's a really good question! >>> > >>> > PDL's "requirements" (when you say e.g. cpanm PDL) are hard >>> requirements for PDL to run: largely File::Map and File::Which. >>> CPAN has a mechanism to "recommend" other modules, including >>> Term::ReadKey. It has done so for a long time. cpanm can be told to >>> install recommended modules. >>> >>> The doubt I have now is, should Term::ReadKey be recommended or should >>> it be required? The problem is that the repl's were installed, but >>> they didn't work without it. >>> >>> > The demos will be sparse... >>> >>> Ok, thanks. I'll pass that info to the students. >>> >>> Regards, >>> Luis >>> >>> -- >>> >>> o >>> W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) >>> Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ >>> Av. Universidad s/n CP 62210 | (*)/\/ \ >>> Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ >>> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
_______________________________________________ pdl-devel mailing list pdl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-devel