user-pic

Tom Wyant

  • Commented on Smart Match in CPAN
    Thank you. The short answer is yes, the modules critiqued are most recent as of 6/24. The long answer is a little more complicated, because there are circumstances when more than one distribution can be "current." One such is when...
  • Posted Smart Match in CPAN to Tom Wyant

    There is nothing like looking, if you want to find something. -- The Hobbit, iv, "Over Hill and Under Hill"

    Recently on the p5p mailing list the topic of removing smart match re-surfaced. There was a fairly vigorous discussion about the effect this would have on CPAN. S…

  • Posted Annotated Perl::Critic Policy Index to Tom Wyant

    In the wake of my postings on the file access tests (-r and friends) I wondered if there was a Perl::Critic policy to find them. So I constructed an

  • Posted My Favorite Modules: <code>File::stat</code> to Tom Wyant

    File::stat overrides the core stat() and lstat() functions. Instead of arrays, the new functions return an object having methods corresponding to…

  • Posted Core Modules: <code>filetest</code> to Tom Wyant

    The filetest pragma modifies the behavior of the file test operators (a.k.a. the -X operators.) It has been in core…

  • Posted The File Access Operators: To Use, or Not to Use to Tom Wyant

    The file access operators are, for the purpose of this blog entry, the file test operators -r, -w, -x,

  • Posted What's In That String? to Tom Wyant

    One of the steps of debugging Perl can be to find out what is actually in a string. There are a number of more-or-less informative ways to do this, and I thought I would compare them.

    For this I used two short strings. The first was just the concatenation of the characters whose ordinals a…

  • Posted My Favorite Modules: Time::Piece to Tom Wyant

    Time::Piece is a date/time module that replaces the built-in functions gmtime() and

  • Posted My Favorite Modules: Errno to Tom Wyant

    The open or die idiom is fairly ubiquitous in Perl. To be useful, the exception should say something about what went wrong: open ... or die "Open error: $!", for example.

    The

  • Commented on Installing Perl: A Chicken-and-Egg Problem
    You are absolutely correct. I should have documented the versions involved when I did the work. But corelist says Perl 5.34.1 was released with CPAN version 2.28, and as of right now my Mini-CPAN contains CPAN version 2.29. It was...
  • Posted Installing Perl: A Chicken-and-Egg Problem to Tom Wyant

    A couple days ago the SD card on a Raspberry Pi lost its beady little mind, and I ended up rebuilding the system from scratch. I generally build my own Perl (also from scratch) and then install the modules I need. So that I can have a log file to rummage through in the event of a problem, I start…

  • Posted XS versus clang: Infinite warnings to Tom Wyant

    Around the beginning of 2022 I started noticing a large number of warnings when compiling XS modules under macOS 12 Monterey. These looked like warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts…

  • Commented on My Favorite Modules: <code>Devel::NYTProf</code>
    Thanks. I may have known that at one point, but I certainly didn't when I was writing this, and the desultory research I did under my self-imposed submission deadline did not flush it out....
  • Posted My Favorite Modules: <code>Devel::NYTProf</code> to Tom Wyant

    'It is a capital mistake to theorize before one has data.' -- Sherlock Holmes, "A Scandal in Bohemia"

    The mental excursion that led to this blog post started with a report from Olaf Alders that my ="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitUnuse…

  • Posted My Favorite Warnings: <code>regexp</code> to Tom Wyant

    'A fair jaw-cracker dwarf-language must be.' -- Samwise Gamgee, The Lord of the Rings, II/iii: "The Ring Goes South", as quoted in regcomp.c, the Perl regular expression compiler.

    As you would expect, this category gets you warnings abou…

  • Posted My Favorite Modules: <code>re</code> to Tom Wyant

    The re module provides functionality relating to Perl's regular expressions. It is either a module in the sense of potentially exporting stuff into your name space or a pragma in the sense of modifying the behavior of Perl within a lexical scope, or…

  • Posted My Favorite Warnings: <code>precedence</code> to Tom Wyant

    Perl possesses a rich and expressive set of operators. So rich, in fact, that other adjectives can come to mind, such as prolix, or even Byzantine.

    Requests for help navigating Perl's operator space appear repeatedly on outlets such as PerlMonks. Th…

  • Posted My Favorite Warnings: <code>qw</code> to Tom Wyant

    When I first came to Perl I thought the qw{} construction was pretty neat. Give it a bunch of white-space-delimited text and it gives you back a list separated on the blanks. So

    say for qw{ Fee fie foe fum! };
    

    prints

  • Commented on Do-It-Yourself <code>warnings</code> categories
    Thanks for the update. I knew about warnings::register_categories(), which seems to be able to register pretty much anything, but omitted it because the POD says ... primarily for use by the warnings::register pragma. On the other hand, I missed the...
  • Posted Do-It-Yourself <code>warnings</code> categories to Tom Wyant

    One of the reasons I have not "moved on" from Perl to some other more "modern" language is that Perl gives me such great access to its inner workings. The Do-It-Yourself Lexical Pragmas post from a…

  • Posted My Favorite Warnings: <code>closure</code> to Tom Wyant

    In the context of Perl, a closure is a piece of code that captures a specific instance of a lexical variable. A blog entry a month or so ago explores this in greater detail. If you review this blog entry, though,…

  • Posted Do-It-Yourself Lexical Pragmas to Tom Wyant

    The phrase "Lexical Pragmas" is probably both redundant and ungrammatical (the correct plural of "pragma" being "pragmata", I believe). But the use of "pragma" to mean "Perl module with an all-lower-case name" is fairly common, and I wanted to make clear that this was not what I was talking…

  • Posted My Favorite Warnings: <code>ambiguous</code> to Tom Wyant

    ... computer language design is just like a stroll in the park. Jurassic Park, that is. -- Larry Wall

    Perl's grammar is inherently ambiguous. That is, it is possible for a syntactically correct chunk of Perl to have more than one valid interpretation. Maybe this is because Lar…

  • Commented on My Favorite Warnings: <code>shadow</code>
    Point well taken. I honestly think words like 'occlude' or 'eclipse' are more descriptive, but I do not think they are current in the Perl community....
  • Posted My Favorite Warnings: <code>syntax</code> to Tom Wyant

    Warnings category syntax contains a number of sub-categories representing possibly-problematic syntax. These include ambiguous syntax, problematic bareword usage, invalid

  • Posted My Favorite Warnings: <code>shadow</code> to Tom Wyant

    Who knows what evil lurks in the hearts of men? The Shadow knows!

    OK, Perl does not literally have a warning about a 1930's pulp fiction and radio serial character. But Perl 5.28 introduced ="https://perldoc.perl.or…

  • Commented on Closures
    Correction The statement that each entry into the scope results in a new instance of the [lexical] variable is too strong. It can result in a new instance, but it appears only to do so if the lexical variable is...
  • Posted Closures to Tom Wyant

    A casual remark about closures which I made in My Favorite Warnings: redefine touched off a long off-topic exchange with Aristotle that I thought ought to…

  • Posted My Favorite Warnings: <code>experimental</code> to Tom Wyant

    Perl has had experimental features ever since I started using it at about version 5.6. These were things that were considered useful, but about which there was doubt -- about their final form, whether a satisfactory implementation existed, or whatever.

    Until Perl 5.18, experimental feature…

  • Commented on Addressing CPAN vulnerabilities related to checksums
    Thank you very much for the update. Is it adequate for users of Mini-CPAN to ensure that their ~/.minicpanrc specifies remote: https//www.cpan.org/ (or other trusted server)? Assuming that there is no other reason to mistrust the Mini-CPAN repository, of course....
Subscribe to feed Recent Actions from Tom Wyant

  • Aristotle commented on Closures

    Perl internally stores lexicals for a scope in what it calls pads (an array of variables, essentially). There is a lot of trickery going on to reuse both whole pads as well as individual entries, and generally as much of any allocated internal data structures, as possible. If a variable could be deallocated at the end of a scope, it is instead kept around and used again next time the scope is entered, to avoid throwing all of it away only to create a whole new largely identical variable next time around. In my own testing relating to our conversations on the topic, I also found other weird…

  • nhorne commented on Addressing CPAN vulnerabilities related to checksums

    I have a local mirror which downloads from https://cpan.org, so it's trusted. I then mount the mirror using NFS, so the entry in MyConfig.pm for urllist starts with "file://foo/bar". Even though I know it's trusted I still get:

    Warning: checksum file '/mnt/CPAN/authors/id/G/GB/GBARR/CHECKSUMS' not conforming.

    The cksum does not contain the key 'cpan_path' for 'CPAN-DistnameInfo-0.12.tar.gz'.
    Proceed nonetheless? [no]

    How can I handle this scenario?

  • Yuki Kimoto commented on My Favorite Modules: <code>Devel::NYTProf</code>

    Devel::NYTProf outputs the result of beautiful coloring HTMLs.

  • Matthew Persico commented on Smart Match in CPAN

    It's not that stupid; *I* noticed and made a suggestion which you took. Seems like it worked to me! :-)

  • Toby Inkster commented on Smart Match in CPAN

    If porting code to not use ~~, then match::smart provides a very similar matching function.

Subscribe to feed Responses to Comments from Tom Wyant

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.