<?xml version="1.0" encoding="windows-1252"?>
<node id="86101" title="Re (tilly) 4: Golf challange: match U.S. State names" created="2001-06-06 02:20:48" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="26179">
tilly</author>
<data>
<field name="doctext">
Your subroutine will accept "AK\n" as a state.  Fixing
that takes it to 125.  But I can beat that with the
following 122 character solution (which is what I was
trying to figure out when I posted my first):
&lt;code&gt;
sub state{
$_[0]=~/^\w\w\z/&amp;&amp;grep/$_[0]/,'WVTNHINMSCORIDCAKSDE WIALAR MNCTX NVAZ','FLGAILKTKYMAMDMEMIMOMTNDNENJNYOHOKPAUTWAWY'=~/../g
}
&lt;/code&gt;
OTOH I can improve your idea down to 119:
&lt;code&gt;
sub state {
pop=~/^([CGILPVW]A|[CKUV]T|[HRW]I|A[KLRZ]|CO|DC|DE|FL|I[DLN]|KS|KY|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|SC|SD|TN|TX|WV|WY)\z/
}
&lt;/code&gt;
</field>
<field name="root_node">
86047</field>
<field name="parent_node">
86067</field>
</data>
</node>
