What to say, what to say?

Well, I made a mistake. I read the new Perl Weekly Challenge, noticed that Dave Rolsky has made part one very easy for us, and dived in, and didn’t give the fullest attention to Sawyer X’s Pumpking address and the Keynote, A Neuroscientist’s Guide to Effectiveness. Link to Conference video

Those solutions will likely be blogged later, and I certain rewatch both. Maybe I won’t blog that, though.

Building a Bridge to a Legacy Application (@mscottford)

Link to Conference video

This is a story about reverse-engineering an old Windows application to see how you can interact with it. It’s always fun to see how

Interfaces in Perl5 (@kfly8)

Link to Conference video

This talk is from the organizer of YAPC::Tokyo, and his first time to present to the US. The topic is Function::Interface, and the point is to wrangle the wildly-dynamic nature of Perl, which we have abused for fun and profit for decades, ensuring (in a Java-ish way) that the type the caller sends is the type the function requires, and that the type the caller expects is the type the function returns.

I can imagine that being a big thing for large systems with many developers, but at this moment, my tech crew has shrunk to the limit, so I know what I’m passing and what I’m receiving. It’s an interesting idea, but, as he said, it’s in development and not nearly production ready. Find it on GitHub.

Organized Development with Tmux (@preaction)

Link to Conference video

It was interesting to see the magic involved with tmux. I still need to pull back and see what we get from it that we don’t get from screen. Except for one case, I see it as trying to economize an infinite resource – you can have as many term as you want.

The case that almost makes sense to me is when I might want to look back at a long-running task when I 1) want to move from desktop and laptop to tablet to phone, and/or 2) I don’t trust the connection to the host. But I work on a well-networked university and can rely on the connection quality, and I have yet to care about the session after I leave. Well-presented talk, but I keep going to these things hoping to be convinced, and it’s still not how I work.

Perl Begat Perl (Uri)

Link to Conference video

This is about eval( STRING ). eval( STRING ) is evil. There are two things I pulled from this talk.

The first thing is perhaps the biggest WAT I’ve seen in Perl.

eval 'system("sleep 5");'

The levels of wrong here. First, sleep 5 is valid Perl, so you don’t need to shell out for it. and then either the system or the eval wil do it for you.

“Why you do that, I don’t know”, as Nicolas said. He also said “I can make it worse.”

eval q`system("sleep 5");`

So, there’s that.

The second thing is about the e in s///e.

e is for evaluate, and s/(foo)/print $1/eg prints foo every time it finds foo in whatever it’s working on. OK, but did you know that /e stacks?

my $str1;
my $str = <<'END';
my x is $x my x is $x
END

print $str;
$str1 = $str;
$str1 =~ s/(\$\w+)/$1/g;
print $str1;

$str1 = $str;
$str1 =~ s/(\$\w+)/$1/eeg;
print $str1;

$str1 = $str;
$str1 =~ s/(\$\w+)/$1/eeeg;
print $str1;

## Annotated output
## The original
# my x is $x my x is $x

## /e, meaning $x gets parsed as a name and outputted
# my x is $x my x is $x

## /ee, where "$x" becomes $x and gets parsed
# my x is say "ZED" my x is say "ZED"

## /eee, where "$x" becomes $x and gets evaluated, returning 1
## but saying ZED
# ZED
# ZED
# my x is 1 my x is 1

This is … um .. cool that you can do it, but … do you want to? Ruth suggests this might not be caught by Perl Critic, but, is that a good thing?

If you have any questions or comments, I would be glad to hear it. Ask me on Twitter or make an issue on my blog repo.