in reply to XML::Simple private members

"I need to access the name in order to reduce the number of parameters I'm using between the program's routines."

Just because of this? even you make the code work today, I believe it will stop working not very long after, once Perl's OO has more control over private variables, or the author of the module changes his design.

If the author changes the name of a public method, you can blame everything on him; but if he changes the identifier of a private variable, you have no reason to blame him at all.

Replies are listed 'Best First'.
Re^2: XML::Simple private members
by Solostian (Beadle) on Sep 14, 2005 at 15:16 UTC
    The actual program is much more complex than the prototype I've included here. The filename is required many sub calls away. I know about the risks of using private elements directly and am willing to run the risk at this point. The only other "clean" option left to me would be to make the filename global and I'd rather avoid that if possible.
      "The filename is required many sub calls away."

      If your own program is OO, and store filename as a property of your class, you can access it without pass it as a parameter, the real parameter you need to pass is the class (a blessed hash ref or whatever).

      Then you will not care the many calls in between any more.