in reply to Re^6: Storing/parsing perl data structure in/from a file
in thread Storing/parsing perl data structure in/from a file

see Re^4: Storing/parsing perl data structure in/from a file for how to read unnamed hashes and assigning them in an eval.

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re^7: Storing/parsing perl data structure in/from a file

Replies are listed 'Best First'.
Re^8: Storing/parsing perl data structure in/from a file
by Wilderness (Novice) on Jun 13, 2013 at 19:29 UTC
    Great ! Thanks, Rolf ! Is there a way to do this with multi-level hashes?
      Sorry, but what exactly is your intention?

      If it's just ease of syntax why don't you use YAML like I showed you?

      If it has to be Perl syntax use multilevel arrays like I showed you, too.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        Sorry to make it confusing but my intention is to be able to `do` a file with the information below and flag that key alpha->beta and later alpha->beta->gamma is defined twice. Duplicate keys can be at any level of the multi-level hash.
        { alpha => { beta => { gamma => theta, delta => lambda, }, beta => { gamma => zeta, }, }, },