http://qs321.pair.com?node_id=11119621


in reply to Re^3: Split does not behave like a subroutine (inconsistent perldocs)
in thread Split does not behave like a subroutine

Thanks LanX for the effort and answers! I am very grateful.

To understand something you need to create a conceptual model of it. I have realized that my model of Perl and the perl interpreter was not adequate.

By following your advice to deparse the generated code, I have start to understand what is going on. I have also read some introductions to the perl interpreter.

To know the use of the

Value Stack

This stack stores the values that regular perl code is operating on, usually intermediate values of expressions within a statement. The stack itself is formed of an array of SV pointers.

for the transfer of parameters to and return values from subroutines, helps me to build my model.

Replies are listed 'Best First'.
Re^5: Split does not behave like a subroutine (mental model)
by LanX (Saint) on Jul 22, 2020 at 13:32 UTC
    Yes, that's pretty much also my mental model, I'm glad I helped you.

    And rest assured many people have (unfortunately) a different one. :/

    I wished it was better communicated.

    Part of the problem is that Perl is advertising itself as kind of a natural language with a lot of DWIM and idiomatic constructs, which shows in the style of the docs.

    But at the end you need to communicate the technical basics in a clear, concise and orthogonal way to avoid confusion and frustration thru perceived ambiguities.

    Much potential is wasted here...

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