Please excuse me if this has already been posted -- I searched
Perlmonks for mention of this program, and I was surprised
that it's not here (surely it must be here!). IF it is here,
then my apologies; and in fact, if 'youse guys' can maybe
turn this exercise into a GOLF I think the results might be
very cool.

Anyway, I implemented CGoL using the old version 5.6.1 on our
Unix boxes, but testing it with PuTTY I see that the `clear`
command doesn't seem to work (strange...).

The code initializes the matrix from __DATA__, but you can delete the stuff after __DATA__ and just hand it an input pattern from <>.

One way to speed up this code is to allow two more states, called 'newborn' and 'dying'. Newborns, belonging to a transitional state, are not counted as 'alive' (so there are no spurious additional births), and dying cells can be marked but not yet removed from the board (so they can still contribute toward the overall game state for the current epoch). Finally, once all births and deaths are thus marked, another loop can iterate over the birthlist, setting their states to 'alive', and loop over the deathlist, setting their states to 'dead'. All that to avoid rebuilding the grid each time... is it worth the extra effort?

Of course, there's the CPAN module Game::Life. I should have searched there too. It makes different assumptions; for instance, it requires an actual perl array or arrays for input, whereas my script breaks up lines read from a handle. But his code is nicely modularized in a ... well, in a module.