It's irritating, you joined the elements of a list {Make Cal l} to form a hash-key.

While this might be intended it doesn't seem to be the correct format of "keyed lists"! ³

A keyed list is a list in which each element contains a key and value pair. These element pairs are stored as lists themselves, where the key is the first element of the list, and the value is the second. The key-value pairs are referred to as fields. This is an example of a keyed list:
% package require Tclx 8.4 % keylset person NAME {Frank Zappa} JOB {musician and composer} % list $person {{NAME {Frank Zappa}} {JOB {musician and composer}}}
Fields may contain subfields; `.' is the separator character. Subfields are actually fields where the value is another keyed list. Thus the following list has the top level fields ID and NAME, and subfields NAME.FIRST and NAME.LAST:
{ID 106} {NAME {{FIRST Frank} {LAST Zappa}}}

The difficulty to find valid information on TCL¹ plus the broken data the OP (or his TCL application) provided made me stop working on this task.²

But I like your recursive parser, it's only usable for this special thread (hardcoded levels) , but nevertheless nicely made! =)

Cheers Rolf

( addicted to the Perl Programming Language)

¹) glad to be a Perler...

²) to be honest I finished a kl2hash parser but I don't intend to publish.

³) Never mind, it's legal string syntax in TCL. There is no big difference between lists and strings in that language.


In reply to Re^2: Convert Tcl Keyed List to Perl by LanX
in thread Convert Tcl Keyed List to Perl by bkobs39

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.