How to call a method that is not

    Some modules are in the habit of creating objects from dynamic classes, for example, OK interfaces to databases like to make classes from table field names. In addition, I often want to turn to an element of the structure, which may not exist. Pearl transfers calls to elements that are not there, but to elements of such elements are no longer there. How is this solved? That's what makes an ordinary powder:

    ; defined $ obj-> subobj? $ obj-> subobj-> method: undef

    When such structures piled pretty, had to force myself to stop rebate:

    ; $ obj-> subobj and $ obj-> subobj-> method


    Also popular now: