If your data is that regular, you shouldn't have any problems, given the excellent replies already.

If your data is not as regular as you indicate, I'd go with something like ikegami's Parse::RecDescent solution, as it's more robust, and easier to modify (though if you don't understand how P::R works, you shouldn't blindly adopt it).

What I didn't see (and I'm surprised you weren't chastised for it :), is code that you've already tried. While the replies you've received are top quality, you've been deprived of the experience of learning how to get there yourself. And I wallow in complete self-interest here, because if most of the Seekers Of Perl Wisdom didn't become Givers of Perl Wisdom, Perl Monks would soon become a desert of unanswered questions, along the lines of Earl Sinclair on Dinosaurs, when he starts a call-in TV show. Something like:

Earl: "You're on Ask A Question! What's you're question?"
Caller: "What do they call those little plastic thingies on the end of shoelaces?"
Earl: "Hey, that's a good question...Next caller!"

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re: Pulling data out of { } by QM
in thread Pulling data out of { } by Felix2000

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.