Tom Wyant

  • About: Fine Perl code for over 0.005 centuries.
  • Commented on Looking for Eugene van der Pijll
    Thank you very much. I have sent at least three messages to the cpan dot org address over the last 4 weeks without getting any response. But a new address can't hurt, and I have sent a message to the...
  • Posted Looking for Eugene van der Pijll to Tom Wyant

    Eugene van der Pijll is the author of DateTime::Calendar::Christian, which manipulates dates in either Julian or Gregorian calendars, depending on what the date actually is. This module has not been updated since 2003, and…

  • Commented on Do not pass perl globals as arguments to subroutines
    Well, maybe this is cargo cult. Back in 2010 I spent quite a bit of time tracking down a problem where I was returning the value of $+[0] from a subroutine, and the caller was not receiving the value that...
  • Commented on Do not pass perl globals as arguments to subroutines
    The same kinds of things apply to capture variables. And if you are writing the subroutine, you might want to avoid returning things like this as well, and for similar reasons....
  • Commented on Retraction of Geo::Coder::Geocoder::US
    Geo::Coder::Geocoder::US 0.006_01 just went to PAUSE. There are no functional changes, I just wanted people to see my attempt to mark this module as deprecated and under threat of retraction....
  • Commented on Retraction of Geo::Coder::Geocoder::US
    Thank you all for the feedback, and especially to Neil Bowers for the cookbook. At the moment the only notation about what is going on is in the Changes file, and that is pretty terse. I will make at least...
  • Commented on Retraction of Geo::Coder::Geocoder::US
    I have stopped the deletion of Geo::Coder::Geocoder::US pending input here. This module does not seem to me to be in the same position as the one you have cited, in that Nagios::Plugin was potentially the subject of legal difficulties, whereas...
  • Posted Retraction of Geo::Coder::Geocoder::US to Tom Wyant

    Geo::Coder::Geocoder::US is a Perl module that interfaces to the Geocoding API of Unfortunately that disappeared late 2015. Since this module is therefore useless, I am deleting it from CPAN.

  • Posted Refactor of Perl Critic policy ProhibitUnusedVarsStricter to Tom Wyant

    Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter (whew!) is a Perl Critic policy that attempts to be more stringent about finding unused variables than the core policy of similar name.…

  • Commented on Stupid Regexp Trick: Fail on match
    My stupid trick does not in fact accommodate underscores in numbers like Perl does, but I believe it could could easily be made to do so. I did not do this, frankly, because I did not think about it. There...
  • Posted Stupid Regexp Trick: Fail on match to Tom Wyant

    I found myself one day trying to come up with a regexp that matched

    m/ \G \s* (?:
            (?<oct> 0b[01]+ | 0[0-7]+ | 0x[[:xdigit:]]+ ) |
            (?<float> [+-]?(?=\.?\d)\d*\.?\d*(?:e[+-]?\d+)? )
        (?! \w )

  • Posted Stupid perldoc-search trick to Tom Wyant

    Perl's copious documentation is one of the things that keeps me using it. But a pretty good idea where to start looking, can be like finding the proverbial needle in a haystack.

    Fortunately, we have Joshua ben Jo…

  • Commented on MacPorts openssl versus Perl
    In follow-up post Son of MacPorts openssl versus Perl I cover how to find all the Perl modules that link to openssl, re-upgrade to the current openssl, and rebuild the necessary modules....
  • Posted Son of MacPorts openssl versus Perl to Tom Wyant

    This post is a follow-up to MacPorts openssl versus Perl. That post told of a problem with a recent MacPorts openssl upgrade, and gave a workaround.

    The right thing to do, however, is to use the c…

  • Posted MacPorts openssl versus Perl to Tom Wyant

    This is only of interest to Mac users who link their Perl against

    This morning I found that Perl code that used LWP::Protocol::https was failing, but only when run by the test harness.

    After some flailing around…

  • Posted Stupid state trick to Tom Wyant

    Occasionally I find myself writing a Perl subroutine that uses a module that no other part of the code needs. This subroutine may be called multiple times, or not at all. At some point I wondered if putting some logic around the require statement would be faster…

  • Commented on Converting glob patterns to regular expressions
    Minor tweak: if you are matching file names like File::Glob does, you need to exclude '/' from the characters matched by the wildcards. Unless you are allowing '**' to match truly anything, in which case you need to distinguish it...
  • Commented on Serializers for Perl: when to use what
    Small carp: Storable does not do Regexps, at least out of the box. $ perl -MStorable -E 'store qr{ fubar }smx, fubar.tmp' Can't store REGEXP items at /.../lib/site_perl/5.20.1/darwin-2level/ line 259, at -e line 1. $ perl -v; modver Storable This...
  • Posted The Case of the Preferred Parent to Tom Wyant

    In which Dupin expounds on inter-generational relationships.

  • Commented on
    MetaCPAN has a lot of advantages, but there is one thing about which I will miss: the fact that development releases were (so to speak) first-class objects. The author's page showed the latest release regardless of whether it was...
  • Posted Stupid <code>less (1)</code> trick to Tom Wyant

    Do you get tired of reading a man page, or even
    POSIX regex engine instead of something more powerful and Perl-like? I
    know I do. Every time I type

  • Commented on The Problem With Perl Testing
    Very thoughtful. And guilty as charged. The thing that puzzles me is how to reorganize. Tests are code. As code, they can have bugs. More than once I have done a small enhancement and had writing and debugging the test...
  • Posted Announcing Perl::Critic::Policy::ControlStructures::ProhibitForeachHandle to Tom Wyant

    A couple days ago I uploaded a Perl-Critic policy to find and complain about things like foreach ( <FOO> ) {...}. The problem (or at least potential problem) with this is that it sucks the entire file into memory before performing the first iteration. Which…

  • Commented on Comment Submission Error
    I hope the Preview button won't be disabled on the original submission page. It's a lifesaver if your submission has markup in it. Disabling either 'Preview' or 'Submit' or both on the preview page may make a great deal of...
  • Commented on A convention for Changes files
    Vim users may find the following useful: :inoremap <F1> <C-R>=strftime("%Y-%m-%d")<CR> If you're in insert or replace mode, this inserts the current date in the proper format at the cursor when the user hits the <F1> key. In normal mode, :nnoremap...
  • Commented on My Love/Hate Relationship with CPAN Testers
    I love CPAN testers unreservedly, and am puzzled by the OP's apparent belief that he, or at least his failing modules, are stigmatized by test failures. I certainly have never felt this way. It almost makes me wonder of the...
  • Commented on Announcing Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter
    Mithaldu: Thanks for the correction. I could have sworn I went looking for warnings::unused and could not find it, but you can't argue with a working URL. "My mind is going, Dave. I can feel it. I can feel it....
  • Posted Announcing Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter to Tom Wyant

    The subject Perl-Critic policy is an alternate implementation of the core policy Variables::ProhibitUnusedVariables. My implementation attempts to do a more thorough job of finding unused variables.


  • Commented on Don't release experiments to CPAN
    Thank you for the clarification. I have no particular confidence that I could apply your distinction between an experimental module and an experimental implementation to an arbitrary module -- which is not to find fault with you. The fault (if...
  • Commented on Don't release experiments to CPAN
    Why not simply ask people to submit experimental modules under development version numbers? This seems to me (after a grand total of maybe five minutes' thought) to have two advantages over the original proposal: The modules get tested by CPANTESTERS...
Subscribe to feed Recent Actions from Tom Wyant

  • Joel Berger commented on Retraction of Geo::Coder::Geocoder::US

    I have a similar one, Mojo::FriendFeed is dead because friendfeed is dead. That said, I love the code so I let it sit there, a testament to beautiful code that will no longer be burdened by "users" and "services".

  • Neil Bowers commented on Retraction of Geo::Coder::Geocoder::US

    Given the service only recently disappeared, I'd suggest the following:

  • Do a release which is marked as deprecated, both in the doc, the code, and the metadata.
  • Have the code croak with an explanatory error message.
  • In the doc say something like "this will be removed from CPAN in 2018". It will always be available from your BackPAN directory, and github.
  • Put something in your calendar / todo list for January 2018 :-)
  • Aristotle commented on Do not pass perl globals as arguments to subroutines
    And if you are writing the subroutine, you might want to avoid returning things like this as well, and for similar reasons.

    Returning a value makes a copy, so it doesn’t suffer from this problem (outside of an :lvalue subroutine anyway – which is a rare edge case).

    If you are returning a reference, then you may have a problem with the referent being shared with something you did not expect (like DBI’s fetch always returning the same arrayref). But in that case you need a deep copy, not just the shallow copy from copying the re…

  • KES commented on Do not pass perl globals as arguments to subroutines

    Even this first subroutine line will not save you if you will do some debugger stuff:

    sub process {
    my( $state, $sub ) = @_;

    #somewhere in DB::sub:
    process( $DB::single, $DB::sub );

    Here when &process is called the $DB::sub is changed and $sub will get 'DB::process' instead of original value.
    Same logic is applied when you pass $DB::single, but at DB::DB sub when $^D |= (1

  • Aristotle commented on Do not pass perl globals as arguments to subroutines
    I was never able to figure out exactly what was going on […but…] I have made it a practice ever since

    That is pretty much cargo cult by definition. 😊 Not that I can fault you for reacting the way you did; so might I.

    The fact that a match-related variable was involved makes me suspicious immediately – all of them have various scoping and lifetime oddities for reasons of efficiency and/or DWIM. But who knows if that’s really the issue.

    Problem is, this is a situation like with folk remedies: with no tested model of what was going on, your r…

    Subscribe to feed Responses to Comments from Tom Wyant

  • About 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.