in reply to Re^4: What's so wrong with this (dereferencing)code?
in thread What's so wrong with this (dereferencing)code?

my premise that Perl is inconsistent

Perl is far less inconsistent than you think. I won't say it's entirely consistent; there are a (very) few places where it is defined & documented to be inconsistent, and those are there for convenience, i.e. to make Perl DWIMish.

But these aren't that. Perl may seem inconsistent, in the things you've demonstrated, but it's not; you just need to know what Perl is doing. E.g. know the difference between use and require.

  • Comment on Re^5: What's so wrong with this (dereferencing)code?

Replies are listed 'Best First'.
Re^6: What's so wrong with this (dereferencing)code?
by LanX (Saint) on Jun 27, 2024 at 15:15 UTC
    Most "inconsistencies" I know stem from the Perl4 to 5 switch.

    Concepts where kept in the language for backwards compatibility but were "discouraged" (Well kind of)

    This allowed a smooth transition for old code bases, but resulted in a lot of mental overhead and Perl getting a bad press.

    At least the perldocs should have been straightened with a clear philosophy, unfortunately it's often a maze. And many core modules show still the old mindset in their docs, like Exporter

    And these discouraged features still needed to be maintained, which made adding new features without breaking old ones a major headache.

    It's not an easy process...Perl6 tried to break with backwards compatibility, the result is known.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery