Funnies Archives

How to prevent an infinite loop

This loop (assuming you have an /etc/passwd and may read it) runs forever:

while () {
  open my $fh, '<:unix', '/etc/passwd' or die $!;
}

This loop terminates:

while () {
  open my $fh, '<', '/etc/passwd' or die $!;
  binmode $fh, ':unix';
}

Note that you will have to live with some extraneous output:
Too many open files at t.pl line 2.

Btw, you can make it loop forever again this way:

require POSIX;
while () {
  open my $fh, '<', '/etc/passwd' or die $!;
  binmode $fh, ':unix';
  POSIX::close fileno $fh;
}

MakeMaker among the stars

It is part of our solar system now.

Now that’s legacy.

Maybe the fault is, indeed, not in our stars.

To the tune of…

Buddy Burden:

Yes, we had multiple keynotes [at YAPC::NA 2014]. Two or three a day, even. I thought that was a bit weird. My friend David Hand kept joking that we had gone beyond keynotes and were now into keychords.

Quote of the day

Chip Salzenberg:

According to John P. Linderman:

Barring some sort of formal definitions, the C code determines the language (pretty much what happened to trigger this whole thread) rather than the language determining the parser, and that just seems wrong.

WRT Perl 5, I’m afraid that horse is not only out of the barn, but has wandered off the ranch, joined a wild herd, and sired several foals.

Java humour

AbstractSingletonProxyFactoryBean:

Convenient proxy factory bean superclass for proxy factory beans that create only singletons.

The New #email Epistles

<rjbs> I need to add the _raw and _str variants for everything, so not having them will always be wrong, or at least a mystery
<confound> This is a great mystery. But I am speaking of MIME and delimiters.
<rjbs> Email: the E is for Ephesians?
<confound> Therefore, since we are surrounded by such a great cloud of RFCs, let us throw off every feature that hinders and the proprietary extensions that so easily entangle.
<rjbs> confound: Where were you when I divided the tokens from the whitespace?
<aristotle> confound++ # ephesians
<rjbs> thus marking the first time anyone on IRC was ++'d for Ephesians
<rjbs> Encode always; lookahead without ceasing; in everything, be strict, for this is Postel's will for you.
<confound> Then he will say to those on his left, "Depart from me, you who are marked as spam, into the limitless bitbucket prepared for penis enhancement and chain forwards. For I was using mutt and you sent me a Word document, I sent you mail and you greylisted me, I wrote to the list and you vacation autoreplied, I made an announcement and you clicked 'reply all'."

On consistency

Jan Dubois:

Perl allows you to shoot yourself in the foot. We should not have to go out of our way to guarantee that we always hit the same foot…

When your mind becomes its own echo chamber

I was looking over my old notes recently - I have a file where I keep ideas for projects among other things. These notes are really of any kind: implementation details, user requirements that should be met, project naming ideas. Among the potential projects for some later day is a Twitter client, for which I kept some naming notes. The thought process behind them was to somehow combine “Twitter” with “Perl” (not necessarily in an obvious fashion). I had even arrived at a conclusion.

With the benefit of retrospect, I have no idea what I was thinking.

I had decided that the right name would be “Twipple”.

About Aristotle

user-pic Waxing philosophical