in reply to Re: Accessing Large Else-If Condition in a Separate Files
in thread Accessing Large Else-If Condition in a Separate Files

Why do something on your own if CPAN can do the same for you?

Just store the Hash of Arrays in a serialized format (such as YAML, JSON, XML or even use Data::Dumper to write to a perl file) and you don't have to worry about parsing and writing theses lines by yourself

  • Comment on Re^2: Accessing Large Else-If Condition in a Separate Files

Replies are listed 'Best First'.
Re^3: Accessing Large Else-If Condition in a Separate Files
by neversaint (Deacon) on Jun 05, 2007 at 09:49 UTC
    Hi,
    That's interesting. Can you give example how this can be done with one of those modules?

    ---
    neversaint and everlastingly indebted.......

      Zaxo's update clearly illustrates moritz's point. Because it is *definitely* the way I would approach the problem, and I would hate for you to overlook this solution, I will provide a more explicit example.

      In the code below, you can switch from Data::Dumper to YAML by changing which lines are commented out.

      Program1, which generates and stores the decision hash:

      Program2, which loads and uses the decision hash: