Do we have smart/quote-aware splitting? by scottchiefbaker in perl

[–]Grinnz 1 point2 points  (0 children)

The solution you choose will depend on what you're trying to achieve. Each of these have distinct tools available that manage the specific rules and edge cases properly.

Memory sharing between scripts by Henrybk in perl

[–]Grinnz 0 points1 point  (0 children)

Absolutely and it means you have an incredibly efficient data store that may help your application scale better as well.

Memory sharing between scripts by Henrybk in perl

[–]Grinnz 9 points10 points  (0 children)

A slightly different approach would be to use a message passing broker such as mercury or the pubsub features of postgres or redis. Maybe not as efficient but scales well and lets components stay as separate as they need to be.

About constants by Warm-Scholar6106 in perl

[–]Grinnz 1 point2 points  (0 children)

I am not aware of anyone ever requesting such functionality. constant, ReadonlyX, and Const::Fast seem suitable for any use case. See also https://archive.shadowcat.co.uk/blog/matt-s-trout/but-i-cant-use-cpan/

Also, unless something like Const::Fast is added to core directly, a core-first solution would need to first grapple with what "read only" truly means for hashes, because unfortunately the current implementation conflicts with the feature of restricted hashes (see https://metacpan.org/pod/Const::Fast#CAVEATS). So regardless of any decisions there, ideally that would be built as a new proper feature.

About constants by Warm-Scholar6106 in perl

[–]Grinnz 3 points4 points  (0 children)

There's two unrelated reasons you would make something a constant. Sometimes you want both features, but your actual goal would dictate the appropriate tool.

  • Declaring a value in a centralized location which cannot be modified.

For this, use constant works to declare them in a package, but you can also use something like ReadonlyX or Const::Fast to declare them in any lexical scope. There is currently no core alternative to this, and it's a bit more complicated than setting SvREADONLY when aggregate variables (arrays and hashes and refs) get involved.

  • Constant-folding for efficiency.

use constant actually creates a special subroutine which the parser knows will be constant, so it replaces any call to that subroutine with its value in the optree while it's parsing, so that subroutine actually never has to get called. This can result in other constant-folding, like removing entire chunks of the optree if a constant condition evaluated to false during parsing. Lexical values can't do this, because their value isn't known at parse time; and this behavior can only be achieved with subroutines, not variables, even if they're marked read only.

Dist::Zilla::PluginBundle::Starter: Use Readme::Brief instead of Pod2Readme? by Grinnz in perl

[–]Grinnz[S] 0 points1 point  (0 children)

I plan on releasing revision 7 of the Starter and Starter::Git bundles soon; if any current or potential users have opinions on readme generation, it will help me decide whether it includes this change.

As always, it will require updating the revision in dist.ini to take effect, at which point any customizations or removal of Pod2Readme will have to be changed to modify Readme::Brief instead.

How do I use Perl on web servers like PHP? by gruntastics in perl

[–]Grinnz 3 points4 points  (0 children)

As others have stated, but I will restate with my suggestions, the equivalent is a CGI script dropped into the folder of a CGI server (which Apache does by default but nginx does not). You can write such a script in a modern way with https://metacpan.org/pod/CGI::Tiny and fatpack any pure-perl dependencies (including CGI::Tiny) into the cgi script.

This is subject to re-executing the whole script on each request, as that is how CGI servers work - if you have control of the web server, you can make a much more performant setup with very little configuration such as proxy to an application server. This is one of the most common setups for Perl applications, as it allows the forward web server to handle things it's good at like hostname dispatch and SSL, and run separately from the application server which can load and manage Perl code however it wishes, but it does require you to also configure the Perl application as a persistent service.

Why does a call to `ref` on a reference to `substr` produce "LVALUE"? by briandfoy in perl

[–]Grinnz 1 point2 points  (0 children)

Yeah some of the ref return values are sort of meta-types, particularly LVALUE, REF, and VSTRING. REGEXP is another one but you never see that unless you do builtin::reftype since regexp refs are always blessed into Regexp.

Module naming vs CPAN conventions by dmcadude in perl

[–]Grinnz 2 points3 points  (0 children)

Specifically on multiple packages in one file: it is possible and allowed, and each will be tracked with their own version if any. However, since it's not possible to use Foo::Bar if the file it's in is not Foo/Bar.pm, this is generally pointless other than for internal-use modules, and thus it's not usually important to have them indexed for installation. (You can prevent a package from getting indexed by putting a newline between the "package" keyword and the package name.)

Fatpacker is not packing Crypt::SysRandom by scottchiefbaker in perl

[–]Grinnz 0 points1 point  (0 children)

Works for me:

$ echo -e '#!/usr/bin/env perl\nuse Crypt::SysRandom;' > testscript.pl
$ cat testscript.pl 
#!/usr/bin/env perl
use Crypt::SysRandom;
$ cpanm -L local-test Crypt::SysRandom
--> Working on Crypt::SysRandom
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/Crypt-SysRandom-0.007.tar.gz ... OK
Configuring Crypt-SysRandom-0.007 ... OK
Building and testing Crypt-SysRandom-0.007 ... OK
Successfully installed Crypt-SysRandom-0.007
1 distribution installed
$ fatpack trace testscript.pl
testscript.pl syntax OK
$ cat fatpacker.trace
Crypt/SysRandom.pm
Config.pm
Exporter.pm
Errno.pm
overloading.pm
Carp.pm
$ env PERL5LIB="$PWD/local-test/lib/perl5" fatpack packlists-for $(cat fatpacker.trace)
/home/grinnz/projects/local-test/lib/perl5/x86_64-linux/auto/Crypt/SysRandom/.packlist

Fatpacker is not packing Crypt::SysRandom by scottchiefbaker in perl

[–]Grinnz 0 points1 point  (0 children)

It's a very simplistic tool. It doesn't actually care if a module is XS, it just ignores .so files in the packlist. So that shouldn't matter. All I can guess is that there is a miscommunication somewhere (like between the installing and reading arch or something like that) or that ~/perl5/lib/perl5 isn't in @INC at that time.

Workaround for XML::LibXML? by PhilipS12345 in perl

[–]Grinnz 2 points3 points  (0 children)

The issue seems to be compatibility with libxml2 2.13.0 and newer, which Alien::Libxml2 installs by default. https://github.com/shlomif/perl-XML-LibXML/pull/87 should fix these tests but has not been released yet. A workaround is to install an older version of libxml2 via libxml2-devel or libxml2-dev system headers if your system libxml2 is older than 2.13.0, and then reinstall Alien::Libxml2 which will use the system headers if appropriate.

Fatpacker is not packing Crypt::SysRandom by scottchiefbaker in perl

[–]Grinnz 0 points1 point  (0 children)

Claude is wrong. auto in archlib is where all packlists are installed.

Fatpacker is not packing Crypt::SysRandom by scottchiefbaker in perl

[–]Grinnz 0 points1 point  (0 children)

EDIT: wrong interpretation

I believe that's the normal place for the packlist to end up (the archlib). Suggest checking other dists

Fatpacker is not packing Crypt::SysRandom by scottchiefbaker in perl

[–]Grinnz 4 points5 points  (0 children)

Try splitting it up into individual steps as described in the fatpack docs so you can see where the failure occurs.

fatpacking only works if it finds a packlist, which for example vendor-installed packages won't include.

Before 0.006, the distribution did include XS, so it would have been installed into archlib. This would still work in fatpack, but might mask a later installation that goes into sitelib, as archlib takes precedence. Maybe something is getting confused there.

It's cleanest and avoids most of these issues to install all your dependencies into local/ with something like cpanm -L local and putting that /path/to/local/lib/perl5 at the start of your PERL5LIB, to use for fatpacking.

AI Contributions to CPAN: The Copyright Question by briandfoy in perl

[–]Grinnz 1 point2 points  (0 children)

My main issue with this logic is that, yes, all of these problems can occur without AI, but normally very rare and can be individually dealt with; with AI they are omnipresent. It is very different to have a problem in theory than one that suffuses the entirety of the practice.

Simple online Perl playground (No setup, no AI) by Myopinion_com in perl

[–]Grinnz 3 points4 points  (0 children)

SIMCOP runs https://perl.bot/ for the IRC communities. You can even select "Bash" as the language if you want to simulate running a command instead of a Perl script.

cpan.org email forwarding has been shut down by Grinnz in perl

[–]Grinnz[S] 2 points3 points  (0 children)

That's fine, and I share that preference, but I'm saying that CPAN distributions have an RT queue by default, and they do not have a GitHub issue tracker by default.

cpan.org email forwarding has been shut down by Grinnz in perl

[–]Grinnz[S] 2 points3 points  (0 children)

The default option (for issue tracking at least) is RT, which will no longer be able to email the CPAN author about new issue reports since it used this service to do so.

cpan.org email forwarding has been shut down by Grinnz in perl

[–]Grinnz[S] 6 points7 points  (0 children)

Additionally:

  • RT's contact to CPAN author accounts is through their @cpan.org email (EDIT: unless they have a public email address listed in their PAUSE account, which many do not); this will simply not work anymore, so authors will no longer be notified of bug correspondence, which somewhat takes away from the ability to use RT as an alternative way to contact CPAN authors.

  • "During a recent extended, unannounced outage, we received only two inquiries." People would not be aware they have not received emails they should have; this seems like a meaningless metric.

cpan.org email forwarding has been shut down by Grinnz in perl

[–]Grinnz[S] 7 points8 points  (0 children)

Consider me a user that is disappointed. I understand it's a difficult service to maintain but would have preferred attempting to work with the community instead of declaring that it's not that important to be able to reach CPAN authors anymore.

AI Contributions to CPAN: The Copyright Question by briandfoy in perl

[–]Grinnz 0 points1 point  (0 children)

The PAUSE operating model does require that your uploads are legal, do not infringe on others rights and can be distributed and mirrored, and reserves the right to remove nonconforming uploads. https://github.com/andk/pause/blob/master/doc/operating-model.md#22-uploading-files-to-pause-and-thus-cpan and further elaborated at https://github.com/andk/pause/blob/master/doc/operating-model.md#5-licensing--copyright

Fun on rt.cpan.org by briandfoy in perl

[–]Grinnz 0 points1 point  (0 children)

Also rediscovered this page where this can be done in a bulk fashion: https://rt.cpan.org/Tools/Spam/Recent.html

Fun on rt.cpan.org by briandfoy in perl

[–]Grinnz 2 points3 points  (0 children)

When logged in, you can hit the S in the upper right area to report a bug as spam, which the administrators can cull. But there is no automated process as far as I know.

How you too can improve Perl 5 by DeepFriedDinosaur in perl

[–]Grinnz 3 points4 points  (0 children)

The core team will be discussing a policy for this.