in reply to Re^3: Changing Local Variable Out of Context
in thread Changing Local Variable Out of Context

«But worst of all are global vars…using those is like depending on a "side effect"…where needed, PASS THEM in as a ref…» <<You contradict yourself.>>

No, I dont.

A var can be global (in main) AND its in the namespace in subs. But even though its scoped globally, for clarity it CAN BE passed in. The fact that it's referenced, or its value is passed in, doesnt change the fact that its scope is global.

mysub( $::Var )
Doesn't mean that $::Var is no longer GLOBAL.

There is no contradiction. Look for value in contributions, not fault.

Replies are listed 'Best First'.
Re^5: Changing Local Variable Out of Context
by karlgoethebier (Abbot) on Jun 14, 2023 at 15:39 UTC

    I talk about side effects.

    «The Crux of the Biscuit is the Apostrophe»