in reply to Re: Hash of Arrays
in thread Hash of Arrays

actually the the reason i wanted the array is because multiple things will be stored in it...for example.... the input looks like <man> ::= <blah> <man> ::= <blah2> so, basically we can have identical keys on the left side in the input and only one string on the right. So in my hash of arrays I'd need to go through the input storing keys and if there is a duplicate key, store whats on the right side of the ::= into that key. thanks again for your help.

Replies are listed 'Best First'.
Re: Re: Re: Hash of Arrays
by jonadab (Parson) on Oct 13, 2003 at 00:17 UTC
    the input looks like
    <man> ::= <blah> <man> ::= <blah2>

    Ah, in that case you'll want to go with either davido's solution or pg's (whichever one you understand better). I wasn't sure from your original post whether that was the case.


    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
Re: Re: Re: Hash of Arrays
by Anonymous Monk on Oct 12, 2003 at 20:21 UTC
    oh i dont know how to make separate lines in this forum post...but <man>::=<blah> is one line and <man> ::= <blah2> is the second.
      That's why there is documentation below the submission area. And a preview button.

      And a link -- "If something looked unlike you expected it to you might need to check out Writeup Formatting Tips"