Hey, thanks for your quick Respons. You understand what I mean, but it did not work properly. I will specify my question. I'm working with the GDS2Stream module of perl. So I try to create from an inputfile a gds-file recursivly. There is the beginning of one structure and the end of a structure. It Looks like this:
Begin of structure-> #something to draw #anything else to draw #something to draw End of Structure Begin of structure-> #something to draw end of structure
The begin of structure is a specific Name. And means the key of my hash. Every key contains rrays which are a list of every element I Need to draw within in this structure. The elements of the Array differs from key to key. So this means the first key is able to have about 10 elements and the second key is able to have about 50 elements;
%hash{@structure_name1} => {[@draw1, @draw2,]}; %hash{@structure_name2} => {[@draw1, @draw2, @draw3]};
And my idea was to find the last element of this Array in the structure and add the end of structure (equal with command printEndstr of the modul)like this:
%hash{@structure_name1} => {[@draw1, @draw2,"$gds2File->printEndstr]}; %hash{@structure_name2} => {[@draw1, @draw2, @draw3, $gds2File->printE +ndstr]};
The Problem is, that in gdsFile there are more Ends of structure and beginnings of structure. I Thing the Problem is the recursion or something like that

In reply to Re^2: add element to hash by Anonymous Monk
in thread add element to hash by Anonymous Monk

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.