user-pic

Ben Bullock

  • Website: www.lemoda.net/
  • About: Perl user since about 2006, I have also released some CPAN modules.
  • Commented on Switch lots of things on at once
    Thanks for commenting, I will be taking a close look at your module when I next need to update/add something. Today I added signatures to this Z thing, I've decided to start using them, since it seems there is some...
  • Posted Switch lots of things on at once to The Incredible Journey

    Many people already have codes like

    use strict;
    use warnings;
    

    and so on at the top of each script they write. For scripts which I don't intend to publish anywhere, I have a module (which I accidentally called Z not knowing there was already a module of the same name on CPAN),…

  • Commented on "My half-life with Perl" from OSCON 2013 live encore performance
    I get "This video is private". https://photos.app.goo.gl/WdSaceG8Kb4Fc5Cu5...
  • Posted Relatively easy ways to catch memory errors to The Incredible Journey

    If you're using XS and C in your Perl module, you might have to worry about memory errors. There are tools like valgrind or memory sanitizer which you can use of course:

    valgrind perl -I blib/lib -I blib/arch ./mytestscript
    

    or if your problems …

  • Commented on A blog post about blog posts
    I think I've read most of what is posted here, but I haven't seen the blog posts you mention full of quotes from unspecified political figures which are offputting for some reason or another. For example a search of this...
  • Commented on I failed to pause before blogging
    There are some very long modules on CPAN, like this one I saw yesterday: https://metacpan.org/release/Lingua-EN-Opinion/source/lib/Lingua/EN/Opinion It has a dictionary of English words, and each word has its own hash reference, with ten different keys. It might be better not to...
  • Commented on I failed to pause before blogging
    https://gist.github.com/benkasminbullock/a55283a3b74aac94b8eedbf45e892260...
  • Commented on I failed to pause before blogging
    Which of those wouldn't be followed by a semicolon? I think package NAMESPACE and package NAMESPACE VERSION are both always followed by one. BLOCK just means {something} doesn't it, so the matching is package\s+.*?\s*(;|\{)....
  • Commented on I failed to pause before blogging
    I think it will help for the next version. It seems to me that PAUSE could check for a semicolon, but there are probably exceptions for that. This line: https://metacpan.org/release/Go-Tokenize/source/lib/Go/Tokenize.pm#L43 also produced an unusual error message, refer to the comment...
  • Posted I failed to pause before blogging to The Incredible Journey

    I got this email from PAUSE just now:

    Failed: PAUSE indexer report BKB/Go-Tokenize-0.01.tar.gz
    
         module : switch
    

    It looks like it doesn't like this line of code containing Go keywords:

  • Posted Gzip::Zopfli - another compression module to The Incredible Journey

    Following on from the Gzip::Libdeflate I mentioned before, I also made this: Gzip::Zopfli

    It is based on the Zopfli gzip compression library from Google Research.

    Both Zopfli and libdeflate seem to excel at compressing JSON fil…

  • Commented on Inline::F2003
    It's OK to upload unfinished modules to CPAN. File::Find is not only on CPAN but in the Perl core and yet it is insufficiently mature to have sensible functionality or documentation. Just think "My module cannot possibly be worse than...
  • Posted New compression module Gzip::Libdeflate to The Incredible Journey

    I've turned the libdeflate compression library into a CPAN module:

    Gzip::Libdeflate

    This is the gzip compression method, but updated.

    It's supposed to be much faster and better than libz (the original gzip library).…

  • Commented on Inline::F2003
    I downloaded it and tried it out. On Perl 5.32.1 there is the problem that you now need to use use lib "."; when the library is in the same directory. This was changed a while ago due to some...
  • Commented on Perl 7: A Modest Proposal
    I went to sign up for the dev.to and it asked me to agree to a bunch of insane gibberish conditions....
  • Posted I found the truth about GameStop, Qanon, the Biden adminstration, and the British Royal Family to The Incredible Journey
  • Commented on Regarding the closure of rt.cpan.
    It seems that it's not possible to log in there any more already, so they've already half-shut-down the whole thing....
  • Commented on Regarding the closure of rt.cpan.
    Has there actually been any effort to email people about this being closed? I think a lot of people don't even know about it. You can find lots of recent distributions on CPAN where the author says to report bugs...
  • Commented on Regarding the closure of rt.cpan.
    You can approve/disapprove comments on blogs.perl.org. I get lots of spam comments, or "asdfg" comments, you can easily remove them....
  • Commented on Mood Lighting
    Video of bulbs would be nice....
  • Commented on You think you're an X, but you're only a Y
    Generally I use the "boolean" module from CPAN if I want to force things: https://metacpan.org/release/boolean It's pretty effective. Probably some Perl person will tell you there is some dreadful thing or another wrong with this module, since that always seems...
  • Commented on You think you're an X, but you're only a Y
    Most people seem to end up using "looks_like_number" in Scalar::Util for these kinds of jobs. https://perldoc.perl.org/Scalar::Util#looks_like_number Apparently it's based on an internal function that Perl uses to distinguish the two: https://perldoc.perl.org/perlapi#looks_like_number I suppose I could use that in the JSON...
  • Posted You think you're an X, but you're only a Y to The Incredible Journey

    The other day I was converting the output of a ="https://metacpan.org/…

  • Commented on Perl Weekly Challenge 94: Group Anagrams and Binary Tree to Linked List
    > "Actually, I even suspect that Perl and Raku arrays are in fact implemented as some form of linked list behind the scene." Perl arrays/lists use C arrays, not linked lists. Here is the source code of av.h (perl 5.32):...
  • Posted ABC Mart to The Incredible Journey

    800px-ABCMART_Minamisomaharamachi_Shop.jpg

    One thing which I like about Mojolicious is that they put all the functions and methods …

  • Commented on From a Reflection on The Weekly Challenge 092 Task 1
    Some people on reddit also answered your query: https://www.reddit.com/r/perl/comments/koahhf/from_a_reflection_on_the_weekly_challenge_092/ The replies might sound a bit sarcastic but that is because it's actually quite a well-known problem....
  • Commented on Perl Weekly Challenge 93: Max Points and Sum Path
    Checking for collinearity of three points in the completely general case is a matter of calculating the determinant of 1 x_1 y_1 1 x_2 y_2 1 x_3 y_3 like this https://github.com/benkasminbullock/perlweeklychallenge-club/blob/master/challenge-093/bkb/perl/ch1.pl#L37-L48 Some other people such as Dave Jacoby had examples...
  • Commented on Perl Weekly Challenge 93: Max Points and Sum Path
    Does your method find (0,0), (1,2), (2,4) collinear?...
  • Commented on From a Reflection on The Weekly Challenge 092 Task 1
    https://gist.github.com/benkasminbullock/79836f8a979f5f2e84d2aa1a8f7b3fea [ben@mikan] {17:30 05} ~ 514 $ perl ch-1.pl '茫茫人海' '夜夜笙歌' 茫茫人海 夜夜笙歌 1 The secret is to bang the rocks together: use Unicode::UTF8 'decode_utf8'; binmode STDOUT, ":encoding(utf8)"; my $l = decode_utf8 ($ARGV[0]); my $r = decode_utf8 ($ARGV[1]); print...
  • Commented on Misusing newSVpv
    Thank you for the kind words. I believe that the newSV() method which I've pointed to is the correct resolution for this particular problem....
Subscribe to feed Recent Actions from Ben Bullock

  • Ron Grunwald commented on Inline::F2003

    Hi Ben,

    I really appreciate you trying out Inline::F2003. And... thank you for reporting the bug. Clearly I need to add the latest Perl release into my test procedure from here on.

    As for CPAN, yes, I can see that would be more convenient. There are several reasons I've decided against a CPAN package; one being that I feel the module is not yet sufficiently mature.

    Thanks again for your time!

    Ron.

  • Aristotle commented on I failed to pause before blogging
    It seems to me that PAUSE could check for a semicolon, but there are probably exceptions for that.

    Indeed there are.

    $ perldoc -f package | head -4
        package NAMESPACE
        package NAMESPACE VERSION
        package NAMESPACE BLOCK
        package NAMESPACE VERSION BLOCK
  • Grinnz commented on I failed to pause before blogging

    There is no reason the BLOCK has to be on the same line either.

    Anyway, making sure you don't have anything following 'package' on the line is an appropriate solution in this case. And probably including a comment so the problem doesn't accidentally reoccur.

  • Toby Inkster commented on I failed to pause before blogging

    I think the indexer probably goes through line by line to avoid slurping in the whole file.

  • Grinnz commented on Switch lots of things on at once

    Also check out Import::Base, which is just a wrapper around Import::Into to make this specific sort of module.

Subscribe to feed Responses to Comments from Ben Bullock

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.