"Tom Edelson" <[EMAIL PROTECTED]> writes:

> > * Perl does lists and hashes _much_ better than DCL;

> I agree, but the advantage isn't quite as enormous as some people
> think, because they haven't noticed that DCL does have built-in
> support for hashes.  It just calls them logical name tables ....

I've been using the DCL symbol table itself for both hash and array, but
it's cumbersome, and as Sandy Fleming points out you can't hash just
anything. Hashes of hashes using the symbol table would work the same way
as "old-style" multilevel hashes in Perl - mung all the keys into
(effectively) one big honkin' one:

$ addr_edelson_tom = "[EMAIL PROTECTED]"
$ addr_fleming_sandy = "[EMAIL PROTECTED]"
$ addr_wyant_tom = "[EMAIL PROTECTED]"
$ if f$type (addr_'p2'_'p1') .eqs. ""
$ then
$ write sys$output p1, " ", p2, "'s address is unknown."
$ else
$ addr = addr_'p2'_'p1'
$ write sys$output p1, " ", p2, "'s address is ", addr, "."
$ endif

I think that the creation of the 'hash table' is little if any longer than
the Perl hash-of-hashes implementation, but it takes seven lines of DCL to
access the 'hash table', versus one for Perl, and the DCL flunks badly on
out-of-band input. Use of a logical name table would allow traversal of the
whole table, but you'd have to do cleanup afterwards, and the out-of-band
character issues are the same.

On the other hand, there's no good place for 'sting', 'enya', or 'eminem'
in the Perl hash-of-hashes implementation (maybe a good thing, depending on
your tastes).

Tom Wyant

Reply via email to