user-pic

Grinnz

  • About: I blog about Perl.
  • Commented on HTTP requests, simply
    That is pretty nice. Test::Mojo provides a similar interface for testing Mojo apps, it's incredibly useful....
  • Posted HTTP requests, simply to Grinnz

    It's long been common to use the LWP::Simple module for quick HTTP requests where you only need to retrieve the contents of a website and put them somewhere. Nowadays I would highly recommend the very neat

  • Commented on I'm not positive about this...
    This is because the unary minus operator is weird. If it's applied to a string that starts with a plus or minus, which isn't a number, it reverses that sign; if it doesn't start with a plus or minus, it...
  • Commented on Is there anything wrong with this benchmark?
    With ->SUPER, your sub is being called first and then it looks up what the superclass is via inheritance. With around, it *creates a new sub* in place and then passes you (at call time) a reference to the previously...
  • Commented on Perl Dependency Checking
    Regarding the blog platform, I completely agree that it has many problems - I tend to still post here for greatest visibility, then post the link to reddit r/perl for comments. There is a grant for creating a modern replacement...
  • Commented on Perl Dependency Checking
    Some other commonly used options are Perl::PrereqScanner (used by the Dist::Zilla [AutoPrereqs] plugin) and Perl::PrereqScanner::Lite (used by scan-prereqs-cpanfile). Scanning prereqs is a **hard** problem to do perfectly, because modules are not always loaded at compile time, or even always as...
  • Commented on Modern Perl CGI
    I appreciate the example of a lower-level alternative, since my post only showed a Mojolicious solution for brevity and because that is where my experience is, and this is certainly a good alternative as well. However, "the Mojolicious example derives...
  • Commented on Modern Perl CGI
    I intentionally did not frame this as "you should use Mojolicious", since I know it is not everyone's cup of tea. There are other alternatives that provide the same benefits. However, Mojolicious (and most of the other options, too) can...
  • Commented on Modern Perl CGI
    I'd like to see the benchmarks of that using the latest Mojolicious with Cpanel::JSON::XS installed, but if that's a problem for an application perhaps it's an indication CGI isn't the right deployment method. Luckily, there's an easy solution for that......
  • Posted Modern Perl CGI to Grinnz

    This is a CGI script, let's call it uppercase.cgi:

    #!/usr/bin/env perl
    use strict;
    use warnings;
    use CGI;
    use Encode::Simple;
    use JSON::MaybeXS;
    use Syntax::Keyword::Try;
    
    my $cgi = CGI->new;
    try {
      my $input = decode 'UTF-8'…
  • Commented on Adding a ROADMAP section to the POD
    You're free to add whatever POD sections you want beyond the standard ones NAME, SYNOPSIS, DESCRIPTION, and some form of COPYRIGHT/LICENSE. The best way to "propose" how to use a section like that is to lead by example and show...
  • Commented on JSON::Transform - transform JSON-able data structures without code
    If you are just looking for retrieval, try JSON::Pointer or Mojo::JSON::Pointer....
  • Commented on Speedup Travis by tweaking your Dist::Zilla config
    Agreed with Graham, and I have made great use of CopyFilesFromRelease + Regenerate::AfterReleasers to have files regenerated at release time (for consistency's sake, and these get automatically committed in the release commit) as well as when I run dzil regenerate...
  • Commented on File::Slurp new version
    genio's current efforts are mostly to fix the obvious bugs and problems with the module's packaging and testing, and fix it for Perl 5.30 which will make sysread on :utf8 handles fatal. For new users, the only real fix is...
  • Commented on Unicode::Properties slated for removal
    While removal is probably fine in this case (and I see that you've already done so), another option is simply to deprecate it and then put the namespace up for adoption. This has the benefit of allowing it to be...
  • Commented on Installing sets of modules
    The biggest problem is that its main feature, that a specific version of it is bundled with the distribution to install it, means that it is impossible to update all of the bundled versions to cope with new installation requirements,...
  • Posted Dist::Zilla Starter revision 3 - Git, versioning, and more to Grinnz

    I've just released revision 3 of the @Starter plugin bundle for the Dist::Zilla CPAN distribution authoring tool. There's no changes to the base configuration from revision 2, but there are now additional options to help…

  • Commented on Installing sets of modules
    You may find mbtiny to your liking. Like many other authoring tools that have come around post-Module::Install, it relies on simply specifying dependencies in a cpanfile (which allows much the same format as Module::Install that you're used to), and has...
  • Posted perldoc.pl now powered by Elasticsearch to Grinnz

    perldoc.pl, the alternative perldoc browser, originally leveraged PostgreSQL full text…

  • Commented on perldoc.pl - A new way to perldoc
    Some updates: Significant improvements to mobile/small browser view, with an expandable navigation menu in those form factors (requires javascript) Entering special variables in search now brings you to a page for that variable...
  • Posted perldoc.pl - A new way to perldoc to Grinnz

    For the past decade or more, perldoc.perl.org has been a useful and convenient resource for viewing perl documentation online. However, it has suffered from lack of maintenance and mounting unfixed…

  • Commented on PrePan
    Another avenue you might try is IRC. #perl on Freenode or #perl-help on irc.perl.org are active and can help with any number of queries regarding the applicability, naming, or design of your modules, and #toolchain on irc.perl.org can help with...
  • Posted A Guide to Versions in Perl to Grinnz

    Version numbers in Perl are very important; they allow orderly updating and maintenance of modules and distributions across the CPAN, and allow CPAN modules and consumers to require the versions of modules with the bugfixes or features they need. However, in…

  • Commented on Stupid Testing Trick: Inconstant Constants
    Though on second thought Foo::MAGIC may get compiled out due to being a constant, before the 'around' takes effect if it wasn't done in BEGIN{}....
  • Commented on Stupid Testing Trick: Inconstant Constants
    imported*. And you don't need to call them as methods, just accessing Foo::MAGIC should work regardless of importing....
  • Commented on Stupid Testing Trick: Inconstant Constants
    You'd need to do the 'around's in a BEGIN{} block for them to take effect before the constants are important from Foo in the 'use' line....
  • Commented on Stupid Testing Trick: Inconstant Constants
    If you don't want to deal with the ugly redefine warnings yourself, you can use Class::Method::Modifiers to wrap an existing function to return something different: use Foo (); use Class::Method::Modifiers; around 'Foo::PLATFORM' => sub () { 9.75 }; around 'Foo::MAGIC'...
  • Posted Encode::Simple - Encode and decode text, simply to Grinnz

    Encode is a well known core module in Perl with support for encoding and decoding text from almost any character encoding you can think of. But it's also an old module with a large amount of historical cruft.

    With inspiration from #perl on freenode IRC, ="https://metacpan.org/pod/En…

  • Commented on Dist::Zilla Check License
    Please do not follow the methods in these blog posts of using Dist::Zilla, they are drawn out, incomplete, and in places counterproductive. Instead I would suggest starting with bundles like Dist::Zilla::PluginBundle::Starter or Dist::Milla, and if you need help, plenty of...
  • Commented on Testing FIDO/U2F Two Factor Authentication
    You can edit posts. Click "Post" on the top bar to go to your dashboard, hope that your session works correctly, probably log in again, and there you can see your entries for editing....
Subscribe to feed Recent Actions from Grinnz

  • Aristotle commented on Modern Perl CGI

    Dave, that won’t work exactly as written because plackup is a script, and you can only use binaries in the shebang. You would have to use

    #!/usr/bin/env plackup

    But I recommend against this. Going through plackup via the shebang line means means that every request requires loading Plack::Runner and then Plack::Loader only to ultimately pass the app to Plack::Handler::CGI… same as you can just do directly. But it doesn’t allow you to deploy an unmodified PSGI app as a CGI script, so you gain nothing more than a little bit of syn…

  • Aristotle commented on Perl Dependency Checking

    The dependency metadata in a CPAN distribution is independent from the code that actually loads the needed modules at runtime, so the two can diverge, and occasionally they do. But it gets noticed quite quickly, most of the time – simply because if the metadata is incorrect then the module won’t work after installing.

    At least usually. Errors that do not produce non-working installations can survive for a long time.

    One way that this can happen is if an error is covered up by other parts of the dependency chain. Imagine that module A needs modules B and C, but the metadat…

  • bigfoot commented on Perl Dependency Checking

    Thanks all for your comments...they were helpful. My takeaway regarding dependencies listed on CPAN is essentially, as Aristotle eloquently penned..."It’s basically trustworthy, but not completely reliable."

  • dmthomas commented on Adding a ROADMAP section to the POD

    For software packages, not just perl distributions, I've long

    STATUS to mention whether
    * it is stable, near-stable, etc
    * is under active development
    * any significant issues/limitations
    * portability

    ROADMAP
    * might have a definite set of milestones
    * and/or major wishlist features, which might or might-not
    be entries in the issue-tracker
    * and/or features that could benefit from more contributors,
    e.g. for porting to Windows
    *…

  • 3ee5cf54-f022-4a71-8666-3c2b5ee231dd [openid.stackexchange.com] commented on I'm not positive about this...

    Personally, I think 1 (obviously) makes sense; the rest are weird Perl unary-minus behaviors. Remember that Perl (unlike shell or C) does not let you concatenate strings by putting them next to each other; instead you have to use . (dot): say "-"."x". (Indeed, say a"x" produces no output — confusing unless you turn on warnings).

    And something like say 1+"x" prints 1; Perl turns the string to a 0 (and prints a warning if enabled) — in every math operator but unary +/-. Perl doesn't do algebra.

    So I find it weird (but docu…

Subscribe to feed Responses to Comments from Grinnz

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.