October 2013 Archives

Stupid less (1) trick

Do you get tired of reading a man page, or even
perldoc, for cryin' out loud, and having to deal with the
POSIX regex engine instead of something more powerful and Perl-like? I
know I do. Every time I type /^[[:space:]]+something,
instead of /^\s+something, it just makes me sick. Something
ought to be done about this nonsense.

Well, after saying something like this to myself for the umpty-jillionth
time, I decided to look into it.

Announcing Perl::Critic::Policy::ControlStructures::ProhibitForeachHandle

A couple days ago I uploaded a Perl-Critic policy to find and complain about things like foreach ( <FOO> ) {...}. The problem (or at least potential problem) with this is that it sucks the entire file into memory before performing the first iteration. Which may be what you wanted, but may not be too.

I plan to leave it at a development release for a couple weeks to allow time for comments and so on. You can find it at its CPAN Search page.

About Tom Wyant

user-pic Fine Perl code for over 0.005 centuries.