RE: [SPOILER] Perl Quiz of the Week #24 (Turing Machine simulation)

"Jurgen Pletinckx" <[email protected]> Fri, 17 Sep 2004 17:08:20 +0200
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
# >     if (/^(\w+)\s+(\w)\s+(\w+)\s+(\w)\s+([LR])\s*$/)
# 
# I'm surprised that all four of the sample solutions posted so far use
# a complicated-looking regex like this instead of going for 'split',
# seemed to me to be the obvious and straightforward technique.

And it's one I used at first. But I didn't like validating the whole
line _and_ each of the arguments separately. 

#   ($STATE, $TAPE[$HEAD], $inc) = @{$ttab->{$TAPE[$HEAD]}};

Nice!

-- 
Jurgen Pletinckx
AlgoNomics NV