June 2011 Archives

When do you upgrade perl?

How do you decide to move to another version of Perl? Some people use the latest version right away, some people make big jumps once a decade. Some never upgrade. What's your style?

I made a SurveyMonkey page for it: http://www.surveymonkey.com/s/DX5HW95.

Pass it around, tweet it, facebook it, buzz it, bump it, do whatever you crazy social kids do. Retweet it.

You don't have to justify anything. I don't really mind if you are using an older pe…

Does do-given work right?

[This is now [perl #93548]]

Perl 5.14 added a return value to given if you put it inside a do. However, it looks like that return value can't be a value in a lexical variable the you define inside the given:

#!/usr/local/perls/perl-5.14.1/bin/perl

use 5.014;

my $foo = 'foo!';

foreach my $string ( qw(foo bar baz quux hoo) ) {
    my $got = do {
        my $bar = 'bar!';
        given( $string ) {
            my $baz = 'baz!';

            when( 'quux' )    { my $quux = 'quux!' }
            when( 'foo' )     { $foo               }
            when( 'bar' )     { $bar               }
            when( 'baz' )     { $baz               }
            default           { 'default'          }
            }
        };

    say "$string got: $got";
    }

This gives me:

foo got: foo!
bar got: bar!
baz got: 
quux got: 
hoo got: default

What am I doing wrong there?

The difference between distros, modules, and programs; and how that affects indexing

Programs, modules, and distributions are different things, but we are often loose with the language. In CPANizing Behavior and Democratizing Publishing, chromatic conflates two issues that are really only loosely connected: making modules and releasing code as a Perl distribution.

Distributions are merely the unit of things we give away. A Perl distribution has a conventional structure, and usually contains modules. However, there's no requirement that it contain any mod…

I'm moving on from the perlfaq

After a long, long time maintaining the perlfaq, I'm moving on from that part of my work in Perl. That leaves a spot for someone else to step in. The latest stuff I had in my briandfoy/branch was merged with blead earlier this week, but any changes I had queued up on my local machine are going to drop through the cracks. I can send that to-do list to anyone who'd like to take on the job.

As such, I'm also stopping the autoposter to comp.lang.perl.misc. This was driving all of the updates as the people in that newsgroup noticed even the most trivial of error…

Bad Mail Day

I really know a lot of Perl people, and whatever is going on in my Gmail account is reminding me of that. For some reason, someone wants the world to think that I want all of you to buy Viagra and watch a stupid YouTube video. I think the YouTube thing is just a red herring for the spam filters. If you don't want to buy fake Viagra, don't follow the stupid links.

Thanks for everyone who responded to the spam to let me know something was going on. I won't respond to the hundreds of messages I got telling me that. At least it's nice to know that people read my mail, even when it is spam…

About brian d foy

user-pic I'm the author of Mastering Perl, and the co-author of Learning Perl (6th Edition), Intermediate Perl, Programming Perl (4th Edition) and Effective Perl Programming (2nd Edition).