user-pic

Tom Wyant

  • 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....
  • Commented on My Favorite Warnings: <code>deprecated</code>
    Thanks. Features can also be removed if it turns out they present a security issue, such as . in @INC....
  • Posted My Favorite Warnings: <code>deprecated</code> to Tom Wyant

    The deprecated warning is a grab-bag. Basically, anything that is deprecated causes this warning to be generated, and the list changes from release to release.

    The only reason I can think of ever to turn this off is around a deprecated cons…

  • Posted My Favorite (?) Warnings - Ex-Warnings to Tom Wyant

    Warning categories have proliferated since the warnings pragma was first introduced in Perl 5.6: from 50 in Perl 5.6.2 to 79 in Perl 5.35.5 (the…

  • Commented on My Favorite Warnings: <code>redefine</code>
    Random thoughts: This will not be the first time your comments have inspired a blog post. See My Favorite Modules: if for how I handled it when I did the write-up. I made the request because I thought if I...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Thanks again. I am comfortable enough with closures for my own uses, but as an autodidact I'm short on theory. I did not exhibit the code that brought me considerably nearer to your level of understanding. What I did there...
  • Posted My Favorite Modules: <code>Term::ReadLine::Perl</code> to Tom Wyant

    Term::ReadLine is a core module (since Perl 5.002) that provides an extremely limited text interface of the prompt-and-type variety. Its main virtue is that you can add a back end which gives it things like…

  • Commented on My Favorite Warnings: <code>redefine</code>
    Yes. I think the thing that tripped me was the idea that a closure and a non-closure could refer to the same instance of a lexical variable. But they can if you hold your tongue right....
  • Commented on My Favorite Warnings: <code>redefine</code>
    Aristotle: The headline of this post is that you have convinced me that the code I said was not a closure actually is one. Thanks for your persistence. Here is my current understanding of the Perl implementation of closures: Any...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Self-reply. On a bit of reflection, I find that my value retention example above is irrelevant to Aristotle's statement about what a closure is. It just illustrates how I think of them, and how I tend to use them. I...
  • Commented on My Favorite Warnings: <code>redefine</code>
    Hm. I would have read the first two sentences of the Google article as requiring retention of values. My standard closure example is sub make_adder { my ( $addend ) = @_; return sub { $_[0] + $addend }; }...
  • Commented on My Favorite Warnings: <code>redefine</code>
    I'm not sure that, strictly speaking, this counts as a closure, though it certainly looks like one. I think of closures as retaining the values of local variables external to the subroutine even if those values subsequently change. The subroutine...
  • Posted My Favorite Warnings: <code>redefine</code> to Tom Wyant

    Sooner or later any programmer, writing in any language, will run across something like this Perl warning: Subroutine foo redefined. This is telling you that somehow, somewhere, you tried to create two subroutines with the same name.

    Tracking this down can …

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

    One of the things the Perl 5 Porters work hard on is issuing diagnostics that are actually diagnostic. I think they do a pretty good job at this, but sometimes I need a bit more explanation than the typical one-line message.

    Now, there is documentation on all of these in ="http://per…

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

    This warning was touched on in A Belated Introduction, but I thought it deserved its own entry.

    When a Perl scalar comes into being, be it an actual scalar variable or an array or h…

  • Posted My Favorite Warnings &mdash; A Belated Introduction to Tom Wyant

    Look, that's why there's rules, understand? So that you think before you break 'em. — Terry Pratchett, in Thief of Time.

    A couple installments into this series of blog posts, I realized an introduction to Perl warnings would be appropriate, with some …

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

    Perl has various ways to transfer control out of the normal flow: die(), goto(), return(), next, last, and

  • Commented on My Favorite Modules: <code>if</code>
    Quite right. In that case you need to go with a BEGIN block, as documented in the POD....
Subscribe to feed Recent Actions from Tom Wyant

  • Robert Rothenberg commented on Addressing CPAN vulnerabilities related to checksums

    PAUSE signatures means that you trust that this is what was uploaded to PAUSE. But it's possible that a malicious person stole an author's credentials to upload something.

    Author signatures means that you trust that the author has approved this code.

    There's always the possibility that a malicious person has stolen PAUSE credentials *and* an author's key-signing credentials. It's not foolproof.

    As an added safety, we could add a scheme for multiple signatures to be added. So another person can review code and submit their signature to PAUSE somehow.

  • Neil Bowers commented on Addressing CPAN vulnerabilities related to checksums

    Thanks Jim - now fixed.

  • Neil Bowers commented on Addressing CPAN vulnerabilities related to checksums
    If the mirror is trustworthy and so is the connection to it, does verification of the PAUSE-signed CHECKSUMS serve any remaining purpose?

    Marginal benefit, I'd say. It's an additional check that you're getting the expected file.

    I've heard anecdotally that the checksums once identified a case where an rsync had been interrupted and result in a truncated file.

  • 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?

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.