in reply to short method to print age.

You can certainly omit some of those -> symbols if you want to.

For example, I'm sure you could write: “$alex->{children}[1]{age}”.

You can also write “$$alex” as a shorthand for “$alex->”.

Just remember to be clear and consistent. Use the directives “use strict; use warnings;” as a matter of inflexible routine.

Replies are listed 'Best First'.
Re^2: short method to print age.
by ikegami (Patriarch) on Mar 05, 2009 at 16:39 UTC
    Saving one character there isn't going to affect the length of the expression. Furthermore, -> is usually much easier to read so your suggestion actually makes things worse.
Re^2: short method to print age.
by Lawliet (Curate) on Mar 05, 2009 at 20:18 UTC

    Wasn't $$alex the original way to dereference? It was considered too confusing (or something) leading to the addition of the arrow operator.

    And you didn't even know bears could type.