On Mon, 17 Jun 2002 16:55:08 -0700, [EMAIL PROTECTED] (Drieux) wrote:
>
>given that your code would generate
>$vc{'TZ'} = 'ok';$vc{'UA'} = 'ok';$vc{'UG'} = 'ok';$vc{'UK'} = 
>'ok';$vc{'UM'} = 'ok';
>$vc{'US'} = 'ok';$vc{'UY'} = 'ok';$vc{'UZ'} = 'ok';$vc{'VA'} = 
>'ok';$vc{'VC'} = 'ok';
>$vc{'VE'} = 'ok';$vc{'VG'} = 'ok';$vc{'VI'} = 'ok';$vc{'VN'} = 
>'ok';$vc{'VU'} = 'ok';
>$vc{'WF'} = 'ok';$vc{'WS'} = 'ok';$vc{'YE'} = 'ok';$vc{'YT'} = 
>'ok';$vc{'YU'} = 'ok';
>$vc{'ZA'} = 'ok';$vc{'ZM'} = 'ok';$vc{'ZR'} = 'ok';$vc{'ZW'} = 'ok';
>
>I'm not too sure that I see what the Improvement here is...
>
>Have you thought about doing say something with map and qw
>that might make it simpler in the long run to maintain such as
>
>       my @keysLower = qw/
>       tz ua ug uk um
>       us uy uz va vc
>       ve vg vi vn vu
>       wf ws ye yt yu
>       za zm zr zw
>       /;
>       my @keysUpper = map { uc } @keysLower;
>
>       my %vc = map { $_ => 'ok'} @keysUpper;
>

Thanks everyone for the replies. It dawned on me that putting the
keys in an array and regenerating the hash is the best solution, as
you guys pointed out.

It really was a matter of curiosity, on how to do the regex, for the
the sake of trying to expand my limited regex abilities.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to