in reply to Novice flails arrays

@Zonelist = ("@WGLZAL","@WGLZAU","@WGLZBL","@WGLZBU", "@WGLZCL","@WGLZCU","@WGLZDL","@WGLZDU");

I really don't like lists of named arrays being used when a hash is a more convenient solution.

my %zonelist; foreach my $zone ('AA'..'ZZ') { my $key = 'WGLZ' . $zone; $zonelist{$key} = [ 'TRUE', 'FALSE' ]; }

or...

my %zonelist = map { 'WGLZ' . $_, ['TRUE','FALSE'] } ( 'AA' .. 'ZZ' );

Of course using an anonymous array holding two strings, "TRUE" and "FALSE" is more of a memory hog than the same anonymous array holding two numeric values: 1, and 0. And even that's more of a hog than a simple scalar value, containing the string "10". ...and that's more of a memory hog than a simple scalar value containing the numeric value of 0, 1, 2, or 3.

In other words, you could replace the anonymous array holding "TRUE" and "FALSE" with a numeric representation like this:

NUMERIC | VAL1 | VAL2 --------+-------+--------- 0 | FALSE | FALSE --------+-------+--------- 1 | FALSE | TRUE --------+-------+--------- 2 | TRUE | FALSE --------+-------+--------- 3 | TRUE | TRUE --------^-------^---------

...and that is starting to look a lot like a job for vec.


Dave